# --------------------------------------------------------------------------
# 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,
    get_three_state_flag,
    get_enum_type,
    resource_group_name_type,
    get_location_type
)
from azure.cli.core.commands.validators import (
    get_default_location_from_resource_group,
    validate_file_or_dict
)
from azext_resource_mover.action import (
    AddIdentity,
    AddDependsOnOverrides
)


def load_arguments(self, _):

    with self.argument_context('resource-mover move-collection show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str,
                   help='The Move Collection Name.', id_part='name')

    with self.argument_context('resource-mover move-collection create') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str,
                   help='The Move Collection Name.')
        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=AddIdentity, nargs='+',
                   help='Defines the MSI properties of the Move Collection.')
        c.argument('source_region', type=str, help='Gets or sets the source region.')
        c.argument('target_region', type=str, help='Gets or sets the target region.')

    with self.argument_context('resource-mover move-collection update') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str,
                   help='The Move Collection Name.', id_part='name')
        c.argument('tags', tags_type)
        c.argument('identity', action=AddIdentity, nargs='+',
                   help='Defines the MSI properties of the Move Collection.')

    with self.argument_context('resource-mover move-collection delete') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str,
                   help='The Move Collection Name.', id_part='name')

    with self.argument_context('resource-mover move-collection bulk-remove') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str, help='',
                   id_part='name')
        c.argument('validate_only', arg_type=get_three_state_flag(), help='Gets or sets a value indicating whether the '
                   'operation needs to only run pre-requisite.')
        c.argument('move_resources', nargs='+', help='Gets or sets the list of resource Id\'s, by default it accepts '
                   'move resource id\'s unless the input type is switched via moveResourceInputType property.')
        c.argument('move_resource_input_type', arg_type=get_enum_type(['MoveResourceId', 'MoveResourceSourceId']),
                   help='Defines the move resource input type.')

    with self.argument_context('resource-mover move-collection commit') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str,
                   help='The Move Collection Name.', id_part='name')
        c.argument('validate_only', arg_type=get_three_state_flag(), help='Gets or sets a value indicating whether the '
                   'operation needs to only run pre-requisite.')
        c.argument('move_resources', nargs='+', help='Gets or sets the list of resource Id\'s, by default it accepts '
                   'move resource id\'s unless the input type is switched via moveResourceInputType property.')
        c.argument('move_resource_input_type', arg_type=get_enum_type(['MoveResourceId', 'MoveResourceSourceId']),
                   help='Defines the move resource input type.')

    with self.argument_context('resource-mover move-collection discard') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str,
                   help='The Move Collection Name.', id_part='name')
        c.argument('validate_only', arg_type=get_three_state_flag(), help='Gets or sets a value indicating whether the '
                   'operation needs to only run pre-requisite.')
        c.argument('move_resources', nargs='+', help='Gets or sets the list of resource Id\'s, by default it accepts '
                   'move resource id\'s unless the input type is switched via moveResourceInputType property.')
        c.argument('move_resource_input_type', arg_type=get_enum_type(['MoveResourceId', 'MoveResourceSourceId']),
                   help='Defines the move resource input type.')

    with self.argument_context('resource-mover move-collection initiate-move') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str,
                   help='The Move Collection Name.', id_part='name')
        c.argument('validate_only', arg_type=get_three_state_flag(), help='Gets or sets a value indicating whether the '
                   'operation needs to only run pre-requisite.')
        c.argument('move_resources', nargs='+', help='Gets or sets the list of resource Id\'s, by default it accepts '
                   'move resource id\'s unless the input type is switched via moveResourceInputType property.')
        c.argument('move_resource_input_type', arg_type=get_enum_type(['MoveResourceId', 'MoveResourceSourceId']),
                   help='Defines the move resource input type.')

    with self.argument_context('resource-mover move-collection list-required-for') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str,
                   help='The Move Collection Name.')
        c.argument('source_id', type=str, help='The sourceId for which the api is invoked.')

    with self.argument_context('resource-mover move-collection prepare') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str,
                   help='The Move Collection Name.', id_part='name')
        c.argument('validate_only', arg_type=get_three_state_flag(), help='Gets or sets a value indicating whether the '
                   'operation needs to only run pre-requisite.')
        c.argument('move_resources', nargs='+', help='Gets or sets the list of resource Id\'s, by default it accepts '
                   'move resource id\'s unless the input type is switched via moveResourceInputType property.')
        c.argument('move_resource_input_type', arg_type=get_enum_type(['MoveResourceId', 'MoveResourceSourceId']),
                   help='Defines the move resource input type.')

    with self.argument_context('resource-mover move-collection resolve-dependency') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str,
                   help='The Move Collection Name.', id_part='name')

    with self.argument_context('resource-mover move-collection wait') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', options_list=['--name', '-n', '--move-collection-name'], type=str,
                   help='The Move Collection Name.', id_part='name')

    with self.argument_context('resource-mover move-resource list') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', type=str, help='The Move Collection Name.')
        c.argument('filter_', options_list=['--filter'], type=str, help='The filter to apply on the operation. For '
                   'example, you can use $filter=Properties/ProvisioningState eq \'Succeeded\'.')

    with self.argument_context('resource-mover move-resource show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', type=str, help='The Move Collection Name.', id_part='name')
        c.argument('move_resource_name', options_list=['--name', '-n', '--move-resource-name'], type=str, help='The '
                   'Move Resource Name.', id_part='child_name_1')

    with self.argument_context('resource-mover move-resource delete') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', type=str, help='The Move Collection Name.', id_part='name')
        c.argument('move_resource_name', options_list=['--name', '-n', '--move-resource-name'], type=str, help='The '
                   'Move Resource Name.', id_part='child_name_1')

    with self.argument_context('resource-mover move-resource add') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', type=str, help='The Move Collection Name.', id_part='name')
        c.argument('move_resource_name', options_list=['--name', '-n', '--move-resource-name'], type=str, help='The '
                   'Move Resource Name.', id_part='child_name_1')
        c.argument('source_id', type=str, help='Gets or sets the Source ARM Id of the resource.')
        c.argument('existing_target_id', type=str, help='Gets or sets the existing target ARM Id of the resource.')
        c.argument('resource_settings', type=validate_file_or_dict, help='Gets or sets the resource settings. Expected '
                   'value: json-string/json-file/@json-file.')
        c.argument('depends_on_overrides', action=AddDependsOnOverrides, nargs='+', help='Gets or sets the move '
                   'resource dependencies overrides.')

    with self.argument_context('resource-mover move-resource wait') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', type=str, help='The Move Collection Name.', id_part='name')
        c.argument('move_resource_name', options_list=['--name', '-n', '--move-resource-name'], type=str, help='The '
                   'Move Resource Name.', id_part='child_name_1')

    with self.argument_context('resource-mover move-collection list-unresolved-dependency') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('move_collection_name', type=str, help='The Move Collection Name.')
        c.argument('dependency_level', arg_type=get_enum_type(['Direct', 'Descendant']), help='Defines the dependency '
                   'level.')
        c.argument('orderby', type=str, help='OData order by query option. For example, you can use $orderby=Count '
                   'desc.')
        c.argument('filter_', options_list=['--filter'], type=str, help='The filter to apply on the operation. For '
                   'example, $apply=filter(count eq 2).')
