# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=too-many-lines
# pylint: disable=too-many-statements

from azure.cli.core.commands.parameters import (
    tags_type,
    resource_group_name_type,
    get_location_type
)
from azure.cli.core.commands.validators import get_default_location_from_resource_group
from azext_offazure.action import (
    AddServicePrincipalIdentityDetails,
    AddAgentDetails
)


def load_arguments(self, _):

    with self.argument_context('offazure hyperv cluster list') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the Hyper-V Site.')

    with self.argument_context('offazure hyperv cluster show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the Hyper-V Site.', id_part='name')
        c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str,
                   help='Name of the cluster.', id_part='child_name_1')

    with self.argument_context('offazure hyperv host list') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the Hyper-V Site.')

    with self.argument_context('offazure hyperv host show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the Hyper-V Site.', id_part='name')
        c.argument('host_name', type=str, options_list=['--name', '-n', '--host-name'],
                   help='Name of the host.', id_part='child_name_1')

    with self.argument_context('offazure hyperv machine list') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the Hyper-V Site.')

    with self.argument_context('offazure hyperv machine show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the Hyper-V Site.', id_part='name')
        c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], type=str,
                   help='Name of the machine.', id_part='child_name_1')

    with self.argument_context('offazure hyperv run-as-account list') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the Hyper-V Site.')

    with self.argument_context('offazure hyperv run-as-account show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the Hyper-V Site.', id_part='name')
        c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str,
                   help='Name of the run-as-account', id_part='child_name_1')

    with self.argument_context('offazure hyperv site show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', options_list=['--name', '-n', '--site-name'], type=str,
                   help='Name of the Hyper-V Site.', id_part='name')

    with self.argument_context('offazure hyperv site create') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', options_list=['--name', '-n', '--site-name'], type=str,
                   help='Name of the Hyper-V Site.')
        c.argument('tags', tags_type)
        c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False,
                   validator=get_default_location_from_resource_group)
        c.argument('identity', action=AddServicePrincipalIdentityDetails, nargs='+',
                   help='Service principal identity details used by agent for communication to the service.')
        c.argument('agent', action=AddAgentDetails, nargs='+', help='On-premises agent details.')
        c.argument('solution_id', type=str, help='ARM ID of migration hub solution for SDS.')
        c.argument('appliance_name', type=str, help='Name of the appliance')

    with self.argument_context('offazure hyperv site delete') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, options_list=['--name', '-n', '--site-name'],
                   help='Name of the Hyper-V Site.', id_part='name')

    with self.argument_context('offazure vmware machine list') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the Hyper-V Site.')

    with self.argument_context('offazure vmware machine show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the VMware site.', id_part='name')
        c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], type=str,
                   help='Name of the machine.', id_part='child_name_1')

    with self.argument_context('offazure vmware run-as-account list') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the VMware site.')

    with self.argument_context('offazure vmware run-as-account show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the VMware site.', id_part='name')
        c.argument('account_name', type=str, options_list=['--name', '-n', '--account-name'],
                   help='Name of the run-as-account', id_part='child_name_1')

    with self.argument_context('offazure vmware site show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', options_list=['--name', '-n', '--site-name'], type=str,
                   help='Name of the VMware site.', id_part='name')

    with self.argument_context('offazure vmware site create') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', options_list=['--name', '-n', '--site-name'], type=str,
                   help='Name of the VMware site.')
        c.argument('tags', tags_type)
        c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False,
                   validator=get_default_location_from_resource_group)
        c.argument('identity', action=AddServicePrincipalIdentityDetails, nargs='+',
                   help='Service principal identity details used by agent for communication to the service.')
        c.argument('agent', action=AddAgentDetails, nargs='+', help='On-premises agent details.')
        c.argument('solution_id', type=str, help='ARM ID of migration hub solution for SDS.')
        c.argument('appliance_name', type=str, help='Name of the appliance')

    with self.argument_context('offazure vmware site delete') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', options_list=['--name', '-n', '--site-name'], type=str,
                   help='Name of the VMware site.', id_part='name')

    with self.argument_context('offazure vmware vcenter list') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the VMware site.')

    with self.argument_context('offazure vmware vcenter show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Name of the VMware site.', id_part='name')
        c.argument('vcenter_name', options_list=['--name', '-n', '--vcenter-name'], type=str,
                   help='VCenter ARM name.', id_part='child_name_1')
