# --------------------------------------------------------------------------
# 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('subscription_id', type=str, help='The ID of the target subscription.')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.')
        c.argument('filter_', options_list=['--filter'], type=str, help='')

    with self.argument_context('offazure hyperv cluster show') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.', id_part='subscription')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.', id_part='name')
        c.argument('cluster_name', type=str, help='Cluster ARM name.', id_part='child_name_1')

    with self.argument_context('offazure hyperv host list') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.')
        c.argument('filter_', options_list=['--filter'], type=str, help='')

    with self.argument_context('offazure hyperv host show') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.', id_part='subscription')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.', id_part='name')
        c.argument('host_name', type=str, help='Host ARM name.', id_part='child_name_1')

    with self.argument_context('offazure hyperv machine list') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.')
        c.argument('filter_', options_list=['--filter'], type=str, help='')
        c.argument('top', type=int, help='')
        c.argument('continuation_token', type=str, help='Optional parameter for continuation token.')
        c.argument('total_record_count', type=int, help='Total count of machines in the given site.')

    with self.argument_context('offazure hyperv machine show') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.', id_part='subscription')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.', id_part='name')
        c.argument('machine_name', type=str, help='Machine ARM name.', id_part='child_name_1')

    with self.argument_context('offazure hyperv run-as-account list') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.')

    with self.argument_context('offazure hyperv run-as-account show') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.', id_part='subscription')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.', id_part='name')
        c.argument('account_name', type=str, help='Run as account ARM name.', id_part='child_name_1')

    with self.argument_context('offazure hyperv site show') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.', id_part='subscription')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.', id_part='name')

    with self.argument_context('offazure hyperv site create') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.')
        c.argument('name', type=str, help='Name of the Hyper-V site.')
        c.argument('tags', tags_type)
        c.argument('e_tag', type=str, help='eTag for concurrency control.')
        c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False,
                   validator=get_default_location_from_resource_group)
        c.argument('service_principal_identity_details', action=AddServicePrincipalIdentityDetails, nargs='+',
                   help='Service principal identity details used by agent for communication to the service.')
        c.argument('agent_details', action=AddAgentDetails, nargs='+', help='On-premises agent details.')
        c.argument('discovery_solution_id', type=str, help='ARM ID of migration hub solution for SDS.')
        c.argument('appliance_name', type=str, help='Appliance Name.')

    with self.argument_context('offazure hyperv site delete') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.', id_part='subscription')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.', id_part='name')

    with self.argument_context('offazure vmware machine list') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.')
        c.argument('filter_', options_list=['--filter'], type=str, help='')
        c.argument('top', type=int, help='')
        c.argument('continuation_token', type=str, help='Optional parameter for continuation token.')
        c.argument('total_record_count', type=int, help='Total count of machines in the given site.')

    with self.argument_context('offazure vmware machine show') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.', id_part='subscription')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.', id_part='name')
        c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], type=str, help='Machine ARM name.',
                   id_part='child_name_1')

    with self.argument_context('offazure vmware run-as-account list') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.')

    with self.argument_context('offazure vmware run-as-account show') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.', id_part='subscription')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.', id_part='name')
        c.argument('account_name', type=str, help='Run as account ARM name.', id_part='child_name_1')

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

    with self.argument_context('offazure vmware site create') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.')
        c.argument('name', type=str, help='Name of the VMware site.')
        c.argument('tags', tags_type)
        c.argument('e_tag', type=str, help='eTag for concurrency control.')
        c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False,
                   validator=get_default_location_from_resource_group)
        c.argument('service_principal_identity_details', action=AddServicePrincipalIdentityDetails, nargs='+',
                   help='Service principal identity details used by agent for communication to the service.')
        c.argument('agent_details', action=AddAgentDetails, nargs='+', help='On-premises agent details.')
        c.argument('discovery_solution_id', type=str, help='ARM ID of migration hub solution for SDS.')
        c.argument('appliance_name', type=str, help='Appliance Name.')

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

    with self.argument_context('offazure vmware vcenter list') as c:
        c.argument('subscription_id', type=str, help='The ID of the target subscription.')
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('site_name', type=str, help='Site name.')
        c.argument('filter_', options_list=['--filter'], type=str, help='')

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