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


def load_arguments(self, _):

    with self.argument_context('connectedmachine list') as c:
        c.argument('resource_group_name', resource_group_name_type)

    with self.argument_context('connectedmachine show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], type=str, help='The name of the '
                   'hybrid machine.', id_part='name')

    with self.argument_context('connectedmachine delete') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], type=str, help='The name of the '
                   'hybrid machine.', id_part='name')

    with self.argument_context('connectedmachine extension list') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('machine_name', type=str, help='The name of the machine containing the extension.')
        c.argument('expand', type=str, help='The expand expression to apply on the operation.')

    with self.argument_context('connectedmachine extension show') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('machine_name', type=str, help='The name of the machine containing the extension.', id_part='name')
        c.argument('name', options_list=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
                   'extension.', id_part='child_name_1')

    with self.argument_context('connectedmachine extension create') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('machine_name', type=str, help='The name of the machine where the extension should be created or '
                   'updated.')
        c.argument('name', options_list=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
                   'extension.')
        c.argument('tags', tags_type)
        c.argument('location', arg_type=get_location_type(self.cli_ctx),
                   validator=get_default_location_from_resource_group)
        c.argument('force_update_tag', type=str, help='How the extension handler should be forced to update even if '
                   'the extension configuration has not changed.')
        c.argument('publisher', type=str, help='The name of the extension handler publisher.')
        c.argument('type_', options_list=['--type'], type=str, help='Specifies the type of the extension; an example '
                   'is "CustomScriptExtension".')
        c.argument('type_handler_version', type=str, help='Specifies the version of the script handler.')
        c.argument('auto_upgrade_minor_version', options_list=['--auto-upgrade-minor'],
                   arg_type=get_three_state_flag(), help='Indicates whether the extension should use a newer minor '
                   'version if one is available at deployment time. Once deployed, however, the extension will not '
                   'upgrade minor versions unless redeployed, even with this property set to true.')
        c.argument('settings', type=validate_file_or_dict, help='Json formatted public settings for the extension. '
                   'Expected value: json-string/@json-file.')
        c.argument('protected_settings', type=validate_file_or_dict, help='The extension can contain either '
                   'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected '
                   'value: json-string/@json-file.')

    with self.argument_context('connectedmachine extension update') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('machine_name', type=str, help='The name of the machine where the extension should be created or '
                   'updated.', id_part='name')
        c.argument('name', options_list=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
                   'extension.', id_part='child_name_1')
        c.argument('tags', tags_type)
        c.argument('force_update_tag', type=str, help='How the extension handler should be forced to update even if '
                   'the extension configuration has not changed.')
        c.argument('publisher', type=str, help='The name of the extension handler publisher.')
        c.argument('type_', options_list=['--type'], type=str, help='Specifies the type of the extension; an example '
                   'is "CustomScriptExtension".')
        c.argument('type_handler_version', type=str, help='Specifies the version of the script handler.')
        c.argument('auto_upgrade_minor_version', options_list=['--auto-upgrade-minor'],
                   arg_type=get_three_state_flag(), help='Indicates whether the extension should use a newer minor '
                   'version if one is available at deployment time. Once deployed, however, the extension will not '
                   'upgrade minor versions unless redeployed, even with this property set to true.')
        c.argument('settings', type=validate_file_or_dict, help='Json formatted public settings for the extension. '
                   'Expected value: json-string/@json-file.')
        c.argument('protected_settings', type=validate_file_or_dict, help='The extension can contain either '
                   'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected '
                   'value: json-string/@json-file.')

    with self.argument_context('connectedmachine extension delete') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('machine_name', type=str, help='The name of the machine where the extension should be deleted.',
                   id_part='name')
        c.argument('name', options_list=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
                   'extension.', id_part='child_name_1')

    with self.argument_context('connectedmachine extension wait') as c:
        c.argument('resource_group_name', resource_group_name_type)
        c.argument('machine_name', type=str, help='The name of the machine containing the extension.', id_part='name')
        c.argument('name', options_list=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
                   'extension.', id_part='child_name_1')
