From 74b60deed29047da913320fdec59678e0791e38f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 9 Nov 2020 16:18:21 +0000 Subject: [PATCH] CodeGen from PR 864 in openapi-env-test/azure-rest-api-specs Merge a1d308dc2a172244ea4c1675637d703d3c0fb70a into 7c940cc3baec39b7c2dc81b905f34885258ddbfa --- src/databox/azext_databox/__init__.py | 44 +- src/databox/azext_databox/action.py | 17 + src/databox/azext_databox/azext_metadata.json | 2 +- src/databox/azext_databox/custom.py | 150 +- .../azext_databox/generated/__init__.py | 12 + .../generated/_client_factory.py | 24 + src/databox/azext_databox/generated/_help.py | 398 ++ .../azext_databox/generated/_params.py | 200 + .../azext_databox/generated/_validators.py | 9 + src/databox/azext_databox/generated/action.py | 227 ++ .../azext_databox/generated/commands.py | 43 + src/databox/azext_databox/generated/custom.py | 231 ++ src/databox/azext_databox/manual/__init__.py | 12 + src/databox/azext_databox/tests/__init__.py | 114 + .../azext_databox/tests/latest/__init__.py | 12 + .../tests/latest/test_databox_scenario.py | 426 +- .../azext_databox/vendored_sdks/__init__.py | 14 +- .../vendored_sdks/databox/__init__.py | 19 +- .../vendored_sdks/databox/_configuration.py | 80 +- .../databox/_data_box_management_client.py | 90 +- .../vendored_sdks/databox/aio/__init__.py | 10 + .../databox/aio/_configuration.py | 66 + .../aio/_data_box_management_client.py | 73 + .../databox/aio/operations/__init__.py | 17 + .../databox/aio/operations/_job_operations.py | 972 +++++ .../aio/operations/_operation_operations.py | 105 + .../aio/operations/_service_operations.py | 390 ++ .../vendored_sdks/databox/models/__init__.py | 329 +- .../_data_box_management_client_enums.py | 368 +- .../vendored_sdks/databox/models/_models.py | 3231 +++++++++------ .../databox/models/_models_py3.py | 3458 +++++++++++------ .../databox/operations/__init__.py | 15 +- .../databox/operations/_job_operations.py | 988 +++++ .../operations/_operation_operations.py | 110 + .../databox/operations/_service_operations.py | 656 ++-- .../vendored_sdks/databox/py.typed | 1 + src/databox/report.md | 351 ++ src/databox/setup.cfg | 3 +- src/databox/setup.py | 21 +- 39 files changed, 9948 insertions(+), 3340 deletions(-) create mode 100644 src/databox/azext_databox/action.py create mode 100644 src/databox/azext_databox/generated/__init__.py create mode 100644 src/databox/azext_databox/generated/_client_factory.py create mode 100644 src/databox/azext_databox/generated/_help.py create mode 100644 src/databox/azext_databox/generated/_params.py create mode 100644 src/databox/azext_databox/generated/_validators.py create mode 100644 src/databox/azext_databox/generated/action.py create mode 100644 src/databox/azext_databox/generated/commands.py create mode 100644 src/databox/azext_databox/generated/custom.py create mode 100644 src/databox/azext_databox/manual/__init__.py create mode 100644 src/databox/azext_databox/tests/__init__.py create mode 100644 src/databox/azext_databox/tests/latest/__init__.py create mode 100644 src/databox/azext_databox/vendored_sdks/databox/aio/__init__.py create mode 100644 src/databox/azext_databox/vendored_sdks/databox/aio/_configuration.py create mode 100644 src/databox/azext_databox/vendored_sdks/databox/aio/_data_box_management_client.py create mode 100644 src/databox/azext_databox/vendored_sdks/databox/aio/operations/__init__.py create mode 100644 src/databox/azext_databox/vendored_sdks/databox/aio/operations/_job_operations.py create mode 100644 src/databox/azext_databox/vendored_sdks/databox/aio/operations/_operation_operations.py create mode 100644 src/databox/azext_databox/vendored_sdks/databox/aio/operations/_service_operations.py create mode 100644 src/databox/azext_databox/vendored_sdks/databox/operations/_job_operations.py create mode 100644 src/databox/azext_databox/vendored_sdks/databox/operations/_operation_operations.py create mode 100644 src/databox/azext_databox/vendored_sdks/databox/py.typed create mode 100644 src/databox/report.md diff --git a/src/databox/azext_databox/__init__.py b/src/databox/azext_databox/__init__.py index f7ea258697c..d4314b0a3a4 100644 --- a/src/databox/azext_databox/__init__.py +++ b/src/databox/azext_databox/__init__.py @@ -1,32 +1,50 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- from azure.cli.core import AzCommandsLoader +from azext_databox.generated._help import helps # pylint: disable=unused-import +try: + from azext_databox.manual._help import helps # pylint: disable=reimported +except ImportError: + pass -import azext_databox._help # pylint: disable=unused-import - -class DataBoxCommandsLoader(AzCommandsLoader): +class DataBoxManagementClientCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType - from azext_databox._client_factory import cf_databox + from azext_databox.generated._client_factory import cf_databox_cl databox_custom = CliCommandType( operations_tmpl='azext_databox.custom#{}', - client_factory=cf_databox) - super(DataBoxCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=databox_custom) + client_factory=cf_databox_cl) + parent = super(DataBoxManagementClientCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=databox_custom) def load_command_table(self, args): - from azext_databox.commands import load_command_table + from azext_databox.generated.commands import load_command_table load_command_table(self, args) + try: + from azext_databox.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass return self.command_table def load_arguments(self, command): - from azext_databox._params import load_arguments + from azext_databox.generated._params import load_arguments load_arguments(self, command) + try: + from azext_databox.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass -COMMAND_LOADER_CLS = DataBoxCommandsLoader +COMMAND_LOADER_CLS = DataBoxManagementClientCommandsLoader diff --git a/src/databox/azext_databox/action.py b/src/databox/azext_databox/action.py new file mode 100644 index 00000000000..d95d53bf711 --- /dev/null +++ b/src/databox/azext_databox/action.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/databox/azext_databox/azext_metadata.json b/src/databox/azext_databox/azext_metadata.json index 13025150393..4f48fa652a5 100644 --- a/src/databox/azext_databox/azext_metadata.json +++ b/src/databox/azext_databox/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isExperimental": true, - "azext.minCliCoreVersion": "2.3.1" + "azext.minCliCoreVersion": "2.11.0" } \ No newline at end of file diff --git a/src/databox/azext_databox/custom.py b/src/databox/azext_databox/custom.py index 37ccab20460..dbe9d5f9742 100644 --- a/src/databox/azext_databox/custom.py +++ b/src/databox/azext_databox/custom.py @@ -1,135 +1,17 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long -# pylint: disable=too-many-statements -# pylint: disable=too-many-lines -# pylint: disable=too-many-locals -# pylint: disable=unused-argument -# pylint: disable=too-many-branches - - -def create_databox_job(client, - resource_group_name, - job_name, - location, - sku, - contact_name, - phone, - city, - email_list, - street_address1, - postal_code, - country, - state_or_province, - destination_account_details, - expected_data_size=None, - tags=None, - mobile=None, - street_address2=None, - street_address3=None, - company_name=None,): - body = {} - body['location'] = location # str - body['tags'] = tags # dictionary - body.setdefault('sku', {})['name'] = sku # str - body.setdefault('details', {})['job_details_type'] = sku - body.setdefault('details', {})['expected_data_size_in_terabytes'] = expected_data_size - body.setdefault('details', {}).setdefault('contact_details', {})['contact_name'] = contact_name # str - body.setdefault('details', {}).setdefault('contact_details', {})['phone'] = phone # str - body.setdefault('details', {}).setdefault('contact_details', {})['mobile'] = mobile # str - body.setdefault('details', {}).setdefault('contact_details', {})['email_list'] = email_list - body.setdefault('details', {}).setdefault('shipping_address', {})['street_address1'] = street_address1 # str - body.setdefault('details', {}).setdefault('shipping_address', {})['street_address2'] = street_address2 # str - body.setdefault('details', {}).setdefault('shipping_address', {})['street_address3'] = street_address3 # str - body.setdefault('details', {}).setdefault('shipping_address', {})['city'] = city # str - body.setdefault('details', {}).setdefault('shipping_address', {})['state_or_province'] = state_or_province # str - body.setdefault('details', {}).setdefault('shipping_address', {})['country'] = country # str - body.setdefault('details', {}).setdefault('shipping_address', {})['postal_code'] = postal_code # str - body.setdefault('details', {}).setdefault('shipping_address', {})['company_name'] = company_name # str - - body.setdefault('details', {})['destination_account_details'] = destination_account_details - - return client.create(resource_group_name=resource_group_name, job_name=job_name, job_resource=body) - - -def update_databox_job(client, - resource_group_name, - job_name, - contact_name=None, - phone=None, - email_list=None, - street_address1=None, - postal_code=None, - country=None, - mobile=None, - city=None, - street_address2=None, - street_address3=None, - state_or_province=None, - company_name=None): - job_resource = get_databox_job(client, resource_group_name, job_name) - job_details = job_resource.details - contact_details = job_details.contact_details - shipping_address = job_details.shipping_address - - body = {} - body.setdefault('details', {}).setdefault('contact_details', {})[ - 'contact_name'] = contact_details.contact_name if contact_name is None else contact_name # str - body.setdefault('details', {}).setdefault('contact_details', {})[ - 'phone'] = contact_details.phone if phone is None else phone # str - body.setdefault('details', {}).setdefault('contact_details', {})[ - 'mobile'] = contact_details.mobile if mobile is None else mobile # str - body.setdefault('details', {}).setdefault('contact_details', {})[ - 'email_list'] = contact_details.email_list if email_list is None else email_list - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'street_address1'] = shipping_address.street_address1 if street_address1 is None else street_address1 # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'street_address2'] = shipping_address.street_address2 if street_address2 is None else street_address2 # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'street_address3'] = shipping_address.street_address3 if street_address3 is None else street_address3 # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'city'] = shipping_address.city if city is None else city # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'state_or_province'] = shipping_address.state_or_province if state_or_province is None else state_or_province # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'country'] = shipping_address.country if country is None else country # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'postal_code'] = shipping_address.postal_code if postal_code is None else postal_code # str - body.setdefault('details', {}).setdefault('shipping_address', {})[ - 'company_name'] = shipping_address.company_name if company_name is None else company_name # str - - return client.update(resource_group_name=resource_group_name, job_name=job_name, job_resource_update_parameter=body) - - -def delete_databox_job(client, - resource_group_name, - job_name): - return client.delete(resource_group_name=resource_group_name, job_name=job_name) - - -def get_databox_job(client, - resource_group_name, - job_name): - return client.get(resource_group_name=resource_group_name, job_name=job_name, expand='details') - - -def list_databox_job(client, - resource_group_name=None): - if resource_group_name is not None: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list() - - -def cancel_databox_job(client, - resource_group_name, - job_name, - reason): - return client.cancel(resource_group_name=resource_group_name, job_name=job_name, reason=reason) - - -def list_credentials_databox_job(client, - resource_group_name, - job_name): - return client.list_credentials(resource_group_name=resource_group_name, job_name=job_name) +# 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=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/databox/azext_databox/generated/__init__.py b/src/databox/azext_databox/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/databox/azext_databox/generated/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/databox/azext_databox/generated/_client_factory.py b/src/databox/azext_databox/generated/_client_factory.py new file mode 100644 index 00000000000..847fbeb0074 --- /dev/null +++ b/src/databox/azext_databox/generated/_client_factory.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + + +def cf_databox_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.databox import DataBoxManagementClient + return get_mgmt_service_client(cli_ctx, + DataBoxManagementClient) + + +def cf_job(cli_ctx, *_): + return cf_databox_cl(cli_ctx).job + + +def cf_service(cli_ctx, *_): + return cf_databox_cl(cli_ctx).service diff --git a/src/databox/azext_databox/generated/_help.py b/src/databox/azext_databox/generated/_help.py new file mode 100644 index 00000000000..b949e14fa33 --- /dev/null +++ b/src/databox/azext_databox/generated/_help.py @@ -0,0 +1,398 @@ +# -------------------------------------------------------------------------- +# 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 + +from knack.help_files import helps + + +helps['databox job'] = """ + type: group + short-summary: databox job +""" + +helps['databox job list'] = """ + type: command + short-summary: "Lists all the jobs available under the given resource group. And Lists all the jobs available \ +under the subscription." + examples: + - name: JobsListByResourceGroup + text: |- + az databox job list --resource-group "SdkRg5154" + - name: JobsList + text: |- + az databox job list +""" + +helps['databox job show'] = """ + type: command + short-summary: "Gets information about the specified job." + examples: + - name: JobsGet + text: |- + az databox job show --expand "details" --name "SdkJob952" --resource-group "SdkRg5154" + - name: JobsGetCmk + text: |- + az databox job show --expand "details" --name "SdkJob1735" --resource-group "SdkRg7937" + - name: JobsGetExport + text: |- + az databox job show --expand "details" --name "SdkJob6429" --resource-group "SdkRg8091" +""" + +helps['databox job create'] = """ + type: command + short-summary: "Creates a new job with the specified parameters. Existing job cannot be updated with this API and \ +should instead be updated with the Update job API." + parameters: + - name: --sku + short-summary: "The sku type." + long-summary: | + Usage: --sku name=XX display-name=XX family=XX + + name: Required. The sku name. + display-name: The display name of the sku. + family: The sku family. + examples: + - name: JobsCreate + text: |- + az databox job create --name "SdkJob952" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/\ +databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\ +\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\ +\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg5154" + - name: JobsCreateDevicePassword + text: |- + az databox job create --name "SdkJob9640" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"sharePassword\\":\\"Abcd223@22344Abcd223@22344\\",\\"storageAccountId\\":\\"/subscriptions\ +/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvt\ +testaccount2\\"}}],\\"devicePassword\\":\\"Abcd223@22344\\",\\"jobDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{\ +\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\ +\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg7478" + - name: JobsCreateDoubleEncryption + text: |- + az databox job create --name "SdkJob6599" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/\ +databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\ +\\"preferences\\":{\\"encryptionPreferences\\":{\\"doubleEncryption\\":\\"Enabled\\"}},\\"shippingAddress\\":{\\"addres\ +sType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"po\ +stalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg608" + - name: JobsCreateExport + text: |- + az databox job create --name "SdkJob6429" --location "westus" --transfer-type "ExportFromAzure" \ +--details "{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"]\ +,\\"phone\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataExportDetails\\":[{\\"accountDetails\\":{\\"dataA\ +ccountType\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resour\ +ceGroups/akvenkat/providers/Microsoft.Storage/storageAccounts/aaaaaa2\\"},\\"transferConfiguration\\":{\\"transferAllDe\ +tails\\":{\\"include\\":{\\"dataAccountType\\":\\"StorageAccount\\",\\"transferAllBlobs\\":true,\\"transferAllFiles\\":\ +true}},\\"transferConfigurationType\\":\\"TransferAll\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{\ +\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\ +\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg8091" + - name: JobsCreateWithUserAssignedIdentity + text: |- + az databox job create --name "SdkJob5337" --identity-type "UserAssigned" --identity-user-assigned-identi\ +ties "{\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdenti\ +ty/userAssignedIdentities/sdkIdentity\\":{}}" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/\ +databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount2\\"}}],\\"jobDetailsType\\":\\"DataBox\\"\ +,\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsof\ +t\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg7552" +""" + +helps['databox job update'] = """ + type: command + short-summary: "Updates the properties of an existing job." + parameters: + - name: --details-shipping-address + short-summary: "Shipping address of the customer." + long-summary: | + Usage: --details-shipping-address street-address1=XX street-address2=XX street-address3=XX city=XX \ +state-or-province=XX country=XX postal-code=XX zip-extended-code=XX company-name=XX address-type=XX + + street-address1: Required. Street Address line 1. + street-address2: Street Address line 2. + street-address3: Street Address line 3. + city: Name of the City. + state-or-province: Name of the State or Province. + country: Required. Name of the Country. + postal-code: Postal code. + zip-extended-code: Extended Zip Code. + company-name: Name of the company. + address-type: Type of address. + - name: --details-key-encryption-key-identity-properties-user-assigned + short-summary: "User assigned identity properties." + long-summary: | + Usage: --details-key-encryption-key-identity-properties-user-assigned resource-id=XX + + resource-id: Arm resource id for user assigned identity to be used to fetch MSI token. + - name: --details-contact-details-notification-preference + short-summary: "Notification preference for a job stage." + long-summary: | + Usage: --details-contact-details-notification-preference stage-name=XX send-notification=XX + + stage-name: Required. Name of the stage. + send-notification: Required. Notification is required or not. + + Multiple actions can be specified by using more than one --details-contact-details-notification-preference \ +argument. + examples: + - name: JobsPatch + text: |- + az databox job update --name "SdkJob952" --resource-group "SdkRg5154" + - name: JobsPatchCmk + text: |- + az databox job update --name "SdkJob1735" --resource-group "SdkRg7937" + - name: JobsPatchSystemAssignedToUserAssigned + text: |- + az databox job update --name "SdkJob2965" --identity-user-assigned-identities \ +"{\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/us\ +erAssignedIdentities/sdkIdentity\\":{}}" --resource-group "SdkRg9765" +""" + +helps['databox job delete'] = """ + type: command + short-summary: "Deletes a job." + examples: + - name: JobsDelete + text: |- + az databox job delete --name "SdkJob952" --resource-group "SdkRg5154" +""" + +helps['databox job book-shipment-pick-up'] = """ + type: command + short-summary: "Book shipment pick up." + examples: + - name: BookShipmentPickupPost + text: |- + az databox job book-shipment-pick-up --name "TJ-636646322037905056" --resource-group "bvttoolrg6" \ +--end-time "2019-09-22T18:30:00Z" --shipment-location "Front desk" --start-time "2019-09-20T18:30:00Z" +""" + +helps['databox job cancel'] = """ + type: command + short-summary: "CancelJob." + examples: + - name: JobsCancelPost + text: |- + az databox job cancel --reason "CancelTest" --name "SdkJob952" --resource-group "SdkRg5154" +""" + +helps['databox job list-credentials'] = """ + type: command + short-summary: "This method gets the unencrypted secrets related to the job." + examples: + - name: JobsListCredentials + text: |- + az databox job list-credentials --name "TJ-636646322037905056" --resource-group "bvttoolrg6" +""" + +helps['databox job wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databox job is met. + examples: + - name: Pause executing next line of CLI script until the databox job is successfully created. + text: |- + az databox job wait --expand "details" --name "SdkJob6429" --resource-group "SdkRg8091" --created + - name: Pause executing next line of CLI script until the databox job is successfully updated. + text: |- + az databox job wait --expand "details" --name "SdkJob6429" --resource-group "SdkRg8091" --updated + - name: Pause executing next line of CLI script until the databox job is successfully deleted. + text: |- + az databox job wait --expand "details" --name "SdkJob6429" --resource-group "SdkRg8091" --deleted +""" + +helps['databox service'] = """ + type: group + short-summary: databox service +""" + +helps['databox service region-configuration'] = """ + type: command + short-summary: "This API provides configuration details specific to given region/location at Subscription level." + parameters: + - name: --data-box-schedule-availability-request + short-summary: "Request body to get the availability for scheduling data box orders orders." + long-summary: | + Usage: --data-box-schedule-availability-request storage-location=XX sku-name=XX country=XX + + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + - name: --disk-schedule-availability-request + short-summary: "Request body to get the availability for scheduling disk orders." + long-summary: | + Usage: --disk-schedule-availability-request expected-data-size-in-terabytes=XX storage-location=XX \ +sku-name=XX country=XX + + expected-data-size-in-terabytes: Required. The expected size of the data, which needs to be transferred in \ +this job, in terabytes. + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + - name: --heavy-schedule-availability-request + short-summary: "Request body to get the availability for scheduling heavy orders." + long-summary: | + Usage: --heavy-schedule-availability-request storage-location=XX sku-name=XX country=XX + + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + examples: + - name: RegionConfiguration + text: |- + az databox service region-configuration --location "westus" --schedule-availability-request \ +"{\\"skuName\\":\\"DataBox\\",\\"storageLocation\\":\\"westus\\"}" +""" + +helps['databox service region-configuration-by-resource-group'] = """ + type: command + short-summary: "This API provides configuration details specific to given region/location at Resource group \ +level." + parameters: + - name: --data-box-schedule-availability-request + short-summary: "Request body to get the availability for scheduling data box orders orders." + long-summary: | + Usage: --data-box-schedule-availability-request storage-location=XX sku-name=XX country=XX + + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + - name: --disk-schedule-availability-request + short-summary: "Request body to get the availability for scheduling disk orders." + long-summary: | + Usage: --disk-schedule-availability-request expected-data-size-in-terabytes=XX storage-location=XX \ +sku-name=XX country=XX + + expected-data-size-in-terabytes: Required. The expected size of the data, which needs to be transferred in \ +this job, in terabytes. + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + - name: --heavy-schedule-availability-request + short-summary: "Request body to get the availability for scheduling heavy orders." + long-summary: | + Usage: --heavy-schedule-availability-request storage-location=XX sku-name=XX country=XX + + storage-location: Required. Location for data transfer. For locations check: \ +https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + sku-name: Required. Sku Name for which the order is to be scheduled. + country: Country in which storage location should be supported. + examples: + - name: RegionConfigurationByResourceGroup + text: |- + az databox service region-configuration-by-resource-group --location "westus" \ +--schedule-availability-request "{\\"skuName\\":\\"DataBox\\",\\"storageLocation\\":\\"westus\\"}" --resource-group \ +"SdkRg4981" +""" + +helps['databox service validate-address'] = """ + type: command + short-summary: "[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer \ +shipping address and provide alternate addresses if any." + parameters: + - name: --shipping-address + short-summary: "Shipping address of the customer." + long-summary: | + Usage: --shipping-address street-address1=XX street-address2=XX street-address3=XX city=XX \ +state-or-province=XX country=XX postal-code=XX zip-extended-code=XX company-name=XX address-type=XX + + street-address1: Required. Street Address line 1. + street-address2: Street Address line 2. + street-address3: Street Address line 3. + city: Name of the City. + state-or-province: Name of the State or Province. + country: Required. Name of the Country. + postal-code: Postal code. + zip-extended-code: Extended Zip Code. + company-name: Name of the company. + address-type: Type of address. + examples: + - name: ValidateAddressPost + text: |- + az databox service validate-address --location "westus" --device-type "DataBox" --shipping-address \ +address-type="Commercial" city="San Francisco" company-name="Microsoft" country="US" postal-code="94107" \ +state-or-province="CA" street-address1="16 TOWNSEND ST" street-address2="Unit 1" --validation-type "ValidateAddress" +""" + +helps['databox service validate-input'] = """ + type: command + short-summary: "This method does all necessary pre-job creation validation under subscription." + parameters: + - name: --create-job-validations + short-summary: "It does all pre-job creation validations." + long-summary: | + Usage: --create-job-validations individual-request-details=XX + + individual-request-details: Required. List of request details contain validationType and its request as \ +key and value respectively. + examples: + - name: ValidateInputs + text: |- + az databox service validate-input --location "westus" --validation-request \ +"{\\"individualRequestDetails\\":[{\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountType\\":\\"StorageAcco\ +unt\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/provider\ +s/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"deviceType\\":\\"DataBox\\",\\"transferType\\":\\"Im\ +portToAzure\\",\\"validationType\\":\\"ValidateDataTransferDetails\\"},{\\"deviceType\\":\\"DataBox\\",\\"shippingAddre\ +ss\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\\ +":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"},\\"transportPreferences\\":{\\"preferredShipmentType\\":\\"MicrosoftManaged\\"\ +},\\"validationType\\":\\"ValidateAddress\\"},{\\"validationType\\":\\"ValidateSubscriptionIsAllowedToCreateJob\\"},{\\\ +"country\\":\\"US\\",\\"deviceType\\":\\"DataBox\\",\\"location\\":\\"westus\\",\\"transferType\\":\\"ImportToAzure\\",\ +\\"validationType\\":\\"ValidateSkuAvailability\\"},{\\"deviceType\\":\\"DataBox\\",\\"validationType\\":\\"ValidateCre\ +ateOrderLimit\\"},{\\"deviceType\\":\\"DataBox\\",\\"preference\\":{\\"transportPreferences\\":{\\"preferredShipmentTyp\ +e\\":\\"MicrosoftManaged\\"}},\\"validationType\\":\\"ValidatePreferences\\"}],\\"validationCategory\\":\\"JobCreationV\ +alidation\\"}" +""" + +helps['databox service validate-input-by-resource-group'] = """ + type: command + short-summary: "This method does all necessary pre-job creation validation under resource group." + parameters: + - name: --create-job-validations + short-summary: "It does all pre-job creation validations." + long-summary: | + Usage: --create-job-validations individual-request-details=XX + + individual-request-details: Required. List of request details contain validationType and its request as \ +key and value respectively. + examples: + - name: ValidateInputsByResourceGroup + text: |- + az databox service validate-input-by-resource-group --location "westus" --resource-group "SdkRg6861" \ +--validation-request "{\\"individualRequestDetails\\":[{\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountT\ +ype\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroup\ +s/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"deviceType\\":\\"DataBox\\",\\"\ +transferType\\":\\"ImportToAzure\\",\\"validationType\\":\\"ValidateDataTransferDetails\\"},{\\"deviceType\\":\\"DataBo\ +x\\",\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Micr\ +osoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"},\\"transportPreferences\\":{\\"preferredShipmentType\\":\\"MicrosoftM\ +anaged\\"},\\"validationType\\":\\"ValidateAddress\\"},{\\"validationType\\":\\"ValidateSubscriptionIsAllowedToCreateJo\ +b\\"},{\\"country\\":\\"US\\",\\"deviceType\\":\\"DataBox\\",\\"location\\":\\"westus\\",\\"transferType\\":\\"ImportTo\ +Azure\\",\\"validationType\\":\\"ValidateSkuAvailability\\"},{\\"deviceType\\":\\"DataBox\\",\\"validationType\\":\\"Va\ +lidateCreateOrderLimit\\"},{\\"deviceType\\":\\"DataBox\\",\\"preference\\":{\\"transportPreferences\\":{\\"preferredSh\ +ipmentType\\":\\"MicrosoftManaged\\"}},\\"validationType\\":\\"ValidatePreferences\\"}],\\"validationCategory\\":\\"Job\ +CreationValidation\\"}" +""" diff --git a/src/databox/azext_databox/generated/_params.py b/src/databox/azext_databox/generated/_params.py new file mode 100644 index 00000000000..d286a69f99d --- /dev/null +++ b/src/databox/azext_databox/generated/_params.py @@ -0,0 +1,200 @@ +# -------------------------------------------------------------------------- +# 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_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_databox.action import ( + AddSku, + AddDetailsShippingAddress, + AddDetailsKeyEncryptionKeyIdentityPropertiesUserAssigned, + AddDetailsContactDetailsNotificationPreference, + AddDataBoxScheduleAvailabilityRequest, + AddDiskScheduleAvailabilityRequest, + AddHeavyScheduleAvailabilityRequest, + AddCreateJobValidations +) + + +def load_arguments(self, _): + + with self.argument_context('databox job list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('skip_token', type=str, help='$skipToken is supported on Get list of jobs, which provides the next ' + 'page in the list of jobs.') + + with self.argument_context('databox job show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + c.argument('expand', type=str, help='$expand is supported on details parameter for job, which provides details ' + 'on the job stages.') + + with self.argument_context('databox job create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku type.') + c.argument('identity_type', type=str, help='Identity type') + c.argument('identity_user_assigned_identities', type=validate_file_or_dict, help='User Assigned Identities ' + 'Expected value: json-string/@json-file.') + c.argument('transfer_type', arg_type=get_enum_type(['ImportToAzure', 'ExportFromAzure']), help='Type of the ' + 'data transfer.') + c.argument('details', type=validate_file_or_dict, help='Details of a job run. This field will only be sent for ' + 'expand details filter. Expected value: json-string/@json-file.') + c.argument('delivery_type', arg_type=get_enum_type(['NonScheduled', 'Scheduled']), + help='Delivery type of Job.') + c.argument('delivery_info_scheduled_date_time', help='Scheduled date time.') + + with self.argument_context('databox job update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + c.argument('if_match', type=str, help='Defines the If-Match condition. The patch will be performed only if the ' + 'ETag of the job on the server matches this value.') + c.argument('tags', tags_type) + c.argument('details_shipping_address', action=AddDetailsShippingAddress, nargs='*', help='Shipping address of ' + 'the customer.') + c.argument('details_key_encryption_key_kek_type', arg_type=get_enum_type(['MicrosoftManaged', + 'CustomerManaged']), help='Type of ' + 'encryption key used for key encryption.') + c.argument('details_key_encryption_key_kek_url', type=str, help='Key encryption key. It is required in case of ' + 'Customer managed KekType.') + c.argument('details_key_encryption_key_kek_vault_resource_id', type=str, help='Kek vault resource id. It is ' + 'required in case of Customer managed KekType.') + c.argument('details_key_encryption_key_identity_properties_type', type=str, help='Managed service identity ' + 'type.') + c.argument('details_key_encryption_key_identity_properties_user_assigned', + action=AddDetailsKeyEncryptionKeyIdentityPropertiesUserAssigned, nargs='*', help='User assigned ' + 'identity properties.') + c.argument('details_contact_details_contact_name', type=str, help='Contact name of the person.') + c.argument('details_contact_details_phone', type=str, help='Phone number of the contact person.') + c.argument('details_contact_details_phone_extension', type=str, help='Phone extension number of the contact ' + 'person.') + c.argument('details_contact_details_mobile', type=str, help='Mobile number of the contact person.') + c.argument('details_contact_details_email_list', nargs='*', help='List of Email-ids to be notified about job ' + 'progress.') + c.argument('details_contact_details_notification_preference', + action=AddDetailsContactDetailsNotificationPreference, nargs='*', help='Notification preference for ' + 'a job stage.') + c.argument('identity_user_assigned_identities', type=validate_file_or_dict, help='User Assigned Identities ' + 'Expected value: json-string/@json-file.') + + with self.argument_context('databox job delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + + with self.argument_context('databox job book-shipment-pick-up') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + c.argument('start_time', help='Minimum date after which the pick up should commence, this must be in local ' + 'time of pick up area.') + c.argument('end_time', help='Maximum date before which the pick up should commence, this must be in local time ' + 'of pick up area.') + c.argument('shipment_location', type=str, help='Shipment Location in the pickup place. Eg.front desk') + + with self.argument_context('databox job cancel') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + c.argument('reason', type=str, help='Reason for cancellation.') + + with self.argument_context('databox job list-credentials') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only') + + with self.argument_context('databox job wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('job_name', options_list=['--name', '-n', '--job-name'], type=str, help='The name of the job ' + 'Resource within the specified resource group. job names must be between 3 and 24 characters in ' + 'length and use any alphanumeric and underscore only', id_part='name') + c.argument('expand', type=str, help='$expand is supported on details parameter for job, which provides details ' + 'on the job stages.') + + with self.argument_context('databox service region-configuration') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), id_part='name') + c.argument('data_box_schedule_availability_request', action=AddDataBoxScheduleAvailabilityRequest, nargs='*', + help='Request body to get the availability for scheduling data box orders orders.', arg_group='' + 'ScheduleAvailabilityRequest') + c.argument('disk_schedule_availability_request', action=AddDiskScheduleAvailabilityRequest, nargs='*', help='' + 'Request body to get the availability for scheduling disk orders.', arg_group='' + 'ScheduleAvailabilityRequest') + c.argument('heavy_schedule_availability_request', action=AddHeavyScheduleAvailabilityRequest, nargs='*', help='' + 'Request body to get the availability for scheduling heavy orders.', arg_group='' + 'ScheduleAvailabilityRequest') + c.argument('transport_availability_request_sku_name', arg_type=get_enum_type(['DataBox', 'DataBoxDisk', '' + 'DataBoxHeavy']), help='Type of ' + 'the device.') + + with self.argument_context('databox service region-configuration-by-resource-group') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group, id_part='name') + c.argument('data_box_schedule_availability_request', action=AddDataBoxScheduleAvailabilityRequest, nargs='*', + help='Request body to get the availability for scheduling data box orders orders.', arg_group='' + 'ScheduleAvailabilityRequest') + c.argument('disk_schedule_availability_request', action=AddDiskScheduleAvailabilityRequest, nargs='*', help='' + 'Request body to get the availability for scheduling disk orders.', arg_group='' + 'ScheduleAvailabilityRequest') + c.argument('heavy_schedule_availability_request', action=AddHeavyScheduleAvailabilityRequest, nargs='*', help='' + 'Request body to get the availability for scheduling heavy orders.', arg_group='' + 'ScheduleAvailabilityRequest') + c.argument('transport_availability_request_sku_name', arg_type=get_enum_type(['DataBox', 'DataBoxDisk', '' + 'DataBoxHeavy']), help='Type of ' + 'the device.') + + with self.argument_context('databox service validate-address') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), id_part='name') + c.argument('validation_type', arg_type=get_enum_type(['ValidateAddress', 'ValidateSubscriptionIsAllowedToCreate' + 'Job', 'ValidatePreferences', 'ValidateCreateOrderLimit', + 'ValidateSkuAvailability', + 'ValidateDataTransferDetails']), help='Identifies the ' + 'type of validation request.') + c.argument('shipping_address', action=AddDetailsShippingAddress, nargs='+', help='Shipping address of the ' + 'customer.') + c.argument('device_type', arg_type=get_enum_type(['DataBox', 'DataBoxDisk', 'DataBoxHeavy']), help='Device ' + 'type to be used for the job.') + c.argument('transport_preferences_preferred_shipment_type', arg_type=get_enum_type(['CustomerManaged', '' + 'MicrosoftManaged']), + help='Indicates Shipment Logistics type that the customer preferred.') + + with self.argument_context('databox service validate-input') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), id_part='name') + c.argument('create_job_validations', action=AddCreateJobValidations, nargs='*', help='It does all pre-job ' + 'creation validations.', arg_group='ValidationRequest') + + with self.argument_context('databox service validate-input-by-resource-group') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group, id_part='name') + c.argument('create_job_validations', action=AddCreateJobValidations, nargs='*', help='It does all pre-job ' + 'creation validations.', arg_group='ValidationRequest') diff --git a/src/databox/azext_databox/generated/_validators.py b/src/databox/azext_databox/generated/_validators.py new file mode 100644 index 00000000000..b33a44c1ebf --- /dev/null +++ b/src/databox/azext_databox/generated/_validators.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/src/databox/azext_databox/generated/action.py b/src/databox/azext_databox/generated/action.py new file mode 100644 index 00000000000..98242ffa876 --- /dev/null +++ b/src/databox/azext_databox/generated/action.py @@ -0,0 +1,227 @@ +# -------------------------------------------------------------------------- +# 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=protected-access + +import argparse +from collections import defaultdict +from knack.util import CLIError + + +class AddSku(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.sku = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + elif kl == 'display-name': + d['display_name'] = v[0] + elif kl == 'family': + d['family'] = v[0] + return d + + +class AddDetailsShippingAddress(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.details_shipping_address = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'street-address1': + d['street_address1'] = v[0] + elif kl == 'street-address2': + d['street_address2'] = v[0] + elif kl == 'street-address3': + d['street_address3'] = v[0] + elif kl == 'city': + d['city'] = v[0] + elif kl == 'state-or-province': + d['state_or_province'] = v[0] + elif kl == 'country': + d['country'] = v[0] + elif kl == 'postal-code': + d['postal_code'] = v[0] + elif kl == 'zip-extended-code': + d['zip_extended_code'] = v[0] + elif kl == 'company-name': + d['company_name'] = v[0] + elif kl == 'address-type': + d['address_type'] = v[0] + return d + + +class AddDetailsKeyEncryptionKeyIdentityPropertiesUserAssigned(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.details_key_encryption_key_identity_properties_user_assigned = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'resource-id': + d['resource_id'] = v[0] + return d + + +class AddDetailsContactDetailsNotificationPreference(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddDetailsContactDetailsNotificationPreference, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'stage-name': + d['stage_name'] = v[0] + elif kl == 'send-notification': + d['send_notification'] = v[0] + return d + + +class AddDataBoxScheduleAvailabilityRequest(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.data_box_schedule_availability_request = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'storage-location': + d['storage_location'] = v[0] + elif kl == 'country': + d['country'] = v[0] + d['sku_name'] = 'DataBox' + return d + + +class AddDiskScheduleAvailabilityRequest(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.disk_schedule_availability_request = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'expected-data-size-in-terabytes': + d['expected_data_size_in_terabytes'] = v[0] + elif kl == 'storage-location': + d['storage_location'] = v[0] + elif kl == 'country': + d['country'] = v[0] + d['sku_name'] = 'DataBoxDisk' + return d + + +class AddHeavyScheduleAvailabilityRequest(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.heavy_schedule_availability_request = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'storage-location': + d['storage_location'] = v[0] + elif kl == 'country': + d['country'] = v[0] + d['sku_name'] = 'DataBoxHeavy' + return d + + +class AddCreateJobValidations(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.create_job_validations = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + d['validation_category'] = "JobCreationValidation" + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'individual-request-details': + d['individual_request_details'] = v + d['validation_category'] = 'JobCreationValidation' + return d diff --git a/src/databox/azext_databox/generated/commands.py b/src/databox/azext_databox/generated/commands.py new file mode 100644 index 00000000000..45b302632b2 --- /dev/null +++ b/src/databox/azext_databox/generated/commands.py @@ -0,0 +1,43 @@ +# -------------------------------------------------------------------------- +# 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-statements +# pylint: disable=too-many-locals + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_databox.generated._client_factory import cf_job + databox_job = CliCommandType( + operations_tmpl='azext_databox.vendored_sdks.databox.operations._job_operations#JobOperations.{}', + client_factory=cf_job) + with self.command_group('databox job', databox_job, client_factory=cf_job, is_experimental=True) as g: + g.custom_command('list', 'databox_job_list') + g.custom_show_command('show', 'databox_job_show') + g.custom_command('create', 'databox_job_create', supports_no_wait=True) + g.custom_command('update', 'databox_job_update', supports_no_wait=True) + g.custom_command('delete', 'databox_job_delete', supports_no_wait=True, confirmation=True) + g.custom_command('book-shipment-pick-up', 'databox_job_book_shipment_pick_up') + g.custom_command('cancel', 'databox_job_cancel') + g.custom_command('list-credentials', 'databox_job_list_credentials') + g.custom_wait_command('wait', 'databox_job_show') + + from azext_databox.generated._client_factory import cf_service + databox_service = CliCommandType( + operations_tmpl='azext_databox.vendored_sdks.databox.operations._service_operations#ServiceOperations.{}', + client_factory=cf_service) + with self.command_group('databox service', databox_service, client_factory=cf_service, is_experimental=True) as g: + g.custom_command('region-configuration', 'databox_service_region_configuration') + g.custom_command('region-configuration-by-resource-group', 'databox_service_region_configuration_by_resource_gr' + 'oup') + g.custom_command('validate-address', 'databox_service_validate_address') + g.custom_command('validate-input', 'databox_service_validate_input') + g.custom_command('validate-input-by-resource-group', 'databox_service_validate_input_by_resource_group') diff --git a/src/databox/azext_databox/generated/custom.py b/src/databox/azext_databox/generated/custom.py new file mode 100644 index 00000000000..fb7895b279c --- /dev/null +++ b/src/databox/azext_databox/generated/custom.py @@ -0,0 +1,231 @@ +# -------------------------------------------------------------------------- +# 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 + +from knack.util import CLIError +from azure.cli.core.util import sdk_no_wait + + +def databox_job_list(client, + resource_group_name=None, + skip_token=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name, + skip_token=skip_token) + return client.list(skip_token=skip_token) + + +def databox_job_show(client, + resource_group_name, + job_name, + expand=None): + return client.get(resource_group_name=resource_group_name, + job_name=job_name, + expand=expand) + + +def databox_job_create(client, + resource_group_name, + job_name, + location, + sku, + transfer_type, + tags=None, + identity_type=None, + identity_user_assigned_identities=None, + details=None, + delivery_type=None, + delivery_info_scheduled_date_time=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + job_name=job_name, + location=location, + tags=tags, + sku=sku, + type=identity_type, + user_assigned_identities=identity_user_assigned_identities, + transfer_type=transfer_type, + details=details, + delivery_type=delivery_type, + scheduled_date_time=delivery_info_scheduled_date_time) + + +def databox_job_update(client, + resource_group_name, + job_name, + if_match=None, + tags=None, + details_shipping_address=None, + details_key_encryption_key_kek_type=None, + details_key_encryption_key_kek_url=None, + details_key_encryption_key_kek_vault_resource_id=None, + details_key_encryption_key_identity_properties_type=None, + details_key_encryption_key_identity_properties_user_assigned=None, + details_contact_details_contact_name=None, + details_contact_details_phone=None, + details_contact_details_phone_extension=None, + details_contact_details_mobile=None, + details_contact_details_email_list=None, + details_contact_details_notification_preference=None, + identity_user_assigned_identities=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + job_name=job_name, + if_match=if_match, + tags=tags, + shipping_address=details_shipping_address, + kek_type=details_key_encryption_key_kek_type, + kek_url=details_key_encryption_key_kek_url, + kek_vault_resource_id=details_key_encryption_key_kek_vault_resource_id, + type=details_key_encryption_key_identity_properties_type, + user_assigned=details_key_encryption_key_identity_properties_user_assigned, + contact_name=details_contact_details_contact_name, + phone=details_contact_details_phone, + phone_extension=details_contact_details_phone_extension, + mobile=details_contact_details_mobile, + email_list=details_contact_details_email_list, + notification_preference=details_contact_details_notification_preference, + user_assigned_identities=identity_user_assigned_identities) + + +def databox_job_delete(client, + resource_group_name, + job_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + job_name=job_name) + + +def databox_job_book_shipment_pick_up(client, + resource_group_name, + job_name, + start_time, + end_time, + shipment_location): + return client.book_shipment_pick_up(resource_group_name=resource_group_name, + job_name=job_name, + start_time=start_time, + end_time=end_time, + shipment_location=shipment_location) + + +def databox_job_cancel(client, + resource_group_name, + job_name, + reason): + return client.cancel(resource_group_name=resource_group_name, + job_name=job_name, + reason=reason) + + +def databox_job_list_credentials(client, + resource_group_name, + job_name): + return client.list_credentials(resource_group_name=resource_group_name, + job_name=job_name) + + +def databox_service_region_configuration(client, + location, + data_box_schedule_availability_request=None, + disk_schedule_availability_request=None, + heavy_schedule_availability_request=None, + transport_availability_request_sku_name=None): + all_schedule_availability_request = [] + if data_box_schedule_availability_request is not None: + all_schedule_availability_request.append(data_box_schedule_availability_request) + if disk_schedule_availability_request is not None: + all_schedule_availability_request.append(disk_schedule_availability_request) + if heavy_schedule_availability_request is not None: + all_schedule_availability_request.append(heavy_schedule_availability_request) + if len(all_schedule_availability_request) > 1: + raise CLIError('at most one of data_box_schedule_availability_request, disk_schedule_availability_request, ' + 'heavy_schedule_availability_request is needed for schedule_availability_request!') + schedule_availability_request = all_schedule_availability_request[0] if len(all_schedule_availability_request) == \ + 1 else None + return client.region_configuration(location=location, + schedule_availability_request=schedule_availability_request, + sku_name=transport_availability_request_sku_name) + + +def databox_service_region_configuration_by_resource_group(client, + resource_group_name, + location, + data_box_schedule_availability_request=None, + disk_schedule_availability_request=None, + heavy_schedule_availability_request=None, + transport_availability_request_sku_name=None): + all_schedule_availability_request = [] + if data_box_schedule_availability_request is not None: + all_schedule_availability_request.append(data_box_schedule_availability_request) + if disk_schedule_availability_request is not None: + all_schedule_availability_request.append(disk_schedule_availability_request) + if heavy_schedule_availability_request is not None: + all_schedule_availability_request.append(heavy_schedule_availability_request) + if len(all_schedule_availability_request) > 1: + raise CLIError('at most one of data_box_schedule_availability_request, disk_schedule_availability_request, ' + 'heavy_schedule_availability_request is needed for schedule_availability_request!') + schedule_availability_request = all_schedule_availability_request[0] if len(all_schedule_availability_request) == \ + 1 else None + return client.region_configuration_by_resource_group(resource_group_name=resource_group_name, + location=location, + schedule_availability_request=schedule_availability_request, + sku_name=transport_availability_request_sku_name) + + +def databox_service_validate_address(client, + location, + validation_type, + shipping_address, + device_type, + transport_preferences_preferred_shipment_type=None): + return client.validate_address(location=location, + validation_type=validation_type, + shipping_address=shipping_address, + device_type=device_type, + preferred_shipment_type=transport_preferences_preferred_shipment_type) + + +def databox_service_validate_input(client, + location, + create_job_validations=None): + all_validation_request = [] + if create_job_validations is not None: + all_validation_request.append(create_job_validations) + if len(all_validation_request) > 1: + raise CLIError('at most one of create_job_validations is needed for validation_request!') + if len(all_validation_request) != 1: + raise CLIError('validation_request is required. but none of create_job_validations is provided!') + validation_request = all_validation_request[0] if len(all_validation_request) == 1 else None + return client.validate_input(location=location, + validation_request=validation_request) + + +def databox_service_validate_input_by_resource_group(client, + resource_group_name, + location, + create_job_validations=None): + all_validation_request = [] + if create_job_validations is not None: + all_validation_request.append(create_job_validations) + if len(all_validation_request) > 1: + raise CLIError('at most one of create_job_validations is needed for validation_request!') + if len(all_validation_request) != 1: + raise CLIError('validation_request is required. but none of create_job_validations is provided!') + validation_request = all_validation_request[0] if len(all_validation_request) == 1 else None + return client.validate_input_by_resource_group(resource_group_name=resource_group_name, + location=location, + validation_request=validation_request) diff --git a/src/databox/azext_databox/manual/__init__.py b/src/databox/azext_databox/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/databox/azext_databox/manual/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/databox/azext_databox/tests/__init__.py b/src/databox/azext_databox/tests/__init__.py new file mode 100644 index 00000000000..50e0627daff --- /dev/null +++ b/src/databox/azext_databox/tests/__init__.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +import inspect +import logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func) + module_path = __path__[0] + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + func_to_call = import_manual_function(func) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/databox/azext_databox/tests/latest/__init__.py b/src/databox/azext_databox/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/databox/azext_databox/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/databox/azext_databox/tests/latest/test_databox_scenario.py b/src/databox/azext_databox/tests/latest/test_databox_scenario.py index 40d34369c2b..ffbb9170c9d 100644 --- a/src/databox/azext_databox/tests/latest/test_databox_scenario.py +++ b/src/databox/azext_databox/tests/latest/test_databox_scenario.py @@ -1,141 +1,309 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- import os +from azure.cli.testsdk import ScenarioTest +from .. import try_manual, raise_if, calc_coverage +from azure.cli.testsdk import ResourceGroupPreparer +from azure.cli.testsdk import StorageAccountPreparer -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer, JMESPathCheck) TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) -class DataBoxScenarioTest(ScenarioTest): +# Env setup +@try_manual +def setup(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + pass + + +# EXAMPLE: JobsCreate +@try_manual +def step_jobscreate(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + test.cmd('az databox job create ' + '--name "{myJob}" ' + '--location "westus" ' + '--transfer-type "ImportToAzure" ' + '--details "{{\\"contactDetails\\":{{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@m' + 'icrosoft.com\\"],\\"phone\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"}},\\"dataImportDetails\\":[' + '{{\\"accountDetails\\":{{\\"dataAccountType\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscripti' + 'ons/{subscription_id}/resourcegroups/{rg_4}/providers/Microsoft.Storage/storageAccounts/{sa}\\"}}}}],\\"j' + 'obDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"S' + 'an Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"' + 'stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit ' + '1\\"}}}}" ' + '--sku name="DataBox" ' + '--resource-group "{rg}"', + checks=[ + test.check("name", "{myJob}", case_sensitive=False), + test.check("location", "westus", case_sensitive=False), + test.check("transferType", "ImportToAzure", case_sensitive=False), + test.check("sku.name", "DataBox", case_sensitive=False), + ]) + + +# EXAMPLE: JobsGet5 +@try_manual +def step_jobsget5(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: JobsGet4 +@try_manual +def step_jobsget4(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: JobsGet3 +@try_manual +def step_jobsget3(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: JobsGet2 +@try_manual +def step_jobsget2(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: JobsGet1 +@try_manual +def step_jobsget1(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: JobsGet +@try_manual +def step_jobsget(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + test.cmd('az databox job show ' + '--expand "details" ' + '--name "{myJob}" ' + '--resource-group "{rg}"', + checks=[ + test.check("name", "{myJob}", case_sensitive=False), + test.check("location", "westus", case_sensitive=False), + test.check("transferType", "ImportToAzure", case_sensitive=False), + test.check("sku.name", "DataBox", case_sensitive=False), + ]) + + +# EXAMPLE: JobsListByResourceGroup +@try_manual +def step_jobslistbyresourcegroup(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, + rg_13): + test.cmd('az databox job list ' + '--resource-group "{rg}"', + checks=[ + test.check('length(@)', 1), + ]) + + +# EXAMPLE: JobsList +@try_manual +def step_jobslist(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + test.cmd('az databox job list ' + '-g ""', + checks=[ + test.check('length(@)', 1), + ]) + + +# EXAMPLE: OperationsGet +@try_manual +def step_operationsget(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: ServiceValidateInputsByResourceGroup +@try_manual +def step_servicevalidateinputsbyresourcegroup(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, + rg_12, rg_13): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: AvailableSkusByResourceGroup +@try_manual +def step_availableskusbyresourcegroup(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, + rg_13): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: BookShipmentPickupPost +@try_manual +def step_bookshipmentpickuppost(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + test.cmd('az databox job book-shipment-pick-up ' + '--name "{myJob8}" ' + '--resource-group "{rg_11}" ' + '--end-time "2019-09-22T18:30:00Z" ' + '--shipment-location "Front desk" ' + '--start-time "2019-09-20T18:30:00Z"', + checks=[]) + + +# EXAMPLE: JobsListCredentials +@try_manual +def step_jobslistcredentials(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + test.cmd('az databox job list-credentials ' + '--name "{myJob8}" ' + '--resource-group "{rg_11}"', + checks=[]) + + +# EXAMPLE: JobsCancelPost +@try_manual +def step_jobscancelpost(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + test.cmd('az databox job cancel ' + '--reason "CancelTest" ' + '--name "{myJob}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: JobsPatch +@try_manual +def step_jobspatch(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + test.cmd('az databox job update ' + '--name "{myJob}" ' + '--resource-group "{rg}"', + checks=[ + test.check("name", "{myJob}", case_sensitive=False), + ]) + + +# EXAMPLE: ServiceRegionConfiguration +@try_manual +def step_serviceregionconfiguration(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, + rg_13): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: ValidateAddressPost +@try_manual +def step_validateaddresspost(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + test.cmd('az databox service validate-address ' + '--location "westus" ' + '--device-type "DataBox" ' + '--shipping-address address-type="Commercial" city="San Francisco" company-name="Microsoft" country="US" ' + 'postal-code="94107" state-or-province="CA" street-address1="16 TOWNSEND ST" street-address2="Unit 1" ' + '--validation-type "ValidateAddress"', + checks=[]) + + +# EXAMPLE: ServiceValidateInputs +@try_manual +def step_servicevalidateinputs(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: AvailableSkusPost +@try_manual +def step_availableskuspost(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: JobsDelete +@try_manual +def step_jobsdelete(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + test.cmd('az databox job delete -y ' + '--name "{myJob}" ' + '--resource-group "{rg}"', + checks=[]) + + +# Env cleanup +@try_manual +def cleanup(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + pass + + +# Testcase +@try_manual +def call_scenario(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + setup(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobscreate(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobsget5(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobsget4(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobsget3(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobsget2(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobsget1(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobsget(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobslistbyresourcegroup(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobslist(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_operationsget(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_servicevalidateinputsbyresourcegroup(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, + rg_12, rg_13) + step_availableskusbyresourcegroup(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, + rg_13) + step_bookshipmentpickuppost(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobslistcredentials(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobscancelpost(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobspatch(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_serviceregionconfiguration(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, + rg_13) + step_validateaddresspost(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_servicevalidateinputs(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_availableskuspost(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + step_jobsdelete(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + cleanup(test, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + + +@try_manual +class DataBoxManagementClientScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestdatabox_databoxbvt'[:7], key='rg_4', parameter_name='rg_4') + @ResourceGroupPreparer(name_prefix='clitestdatabox_databoxbvt1'[:7], key='rg_5', parameter_name='rg_5') + @ResourceGroupPreparer(name_prefix='clitestdatabox_akvenkat'[:7], key='rg_8', parameter_name='rg_8') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg5154'[:7], key='rg', parameter_name='rg') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg7937'[:7], key='rg_2', parameter_name='rg_2') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg8091'[:7], key='rg_3', parameter_name='rg_3') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg7478'[:7], key='rg_6', parameter_name='rg_6') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg608'[:7], key='rg_7', parameter_name='rg_7') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg7552'[:7], key='rg_9', parameter_name='rg_9') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg9765'[:7], key='rg_10', parameter_name='rg_10') + @ResourceGroupPreparer(name_prefix='clitestdatabox_bvttoolrg6'[:7], key='rg_11', parameter_name='rg_11') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg4981'[:7], key='rg_12', parameter_name='rg_12') + @ResourceGroupPreparer(name_prefix='clitestdatabox_SdkRg6861'[:7], key='rg_13', parameter_name='rg_13') + @StorageAccountPreparer(name_prefix='clitestdatabox_databoxbvttestaccount'[:7], key='sa', + resource_group_parameter_name='rg_4') + @StorageAccountPreparer(name_prefix='clitestdatabox_databoxbvttestaccount2'[:7], key='sa_2', + resource_group_parameter_name='rg_5') + @StorageAccountPreparer(name_prefix='clitestdatabox_aaaaaa2'[:7], key='sa_3', + resource_group_parameter_name='rg_8') + def test_databox(self, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13): + + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) - @ResourceGroupPreparer(name_prefix='cli_test_databox') - @StorageAccountPreparer(parameter_name='storage_account_1') - @StorageAccountPreparer(parameter_name='storage_account_2') - def test_databox(self, storage_account_1, storage_account_2): - job_name = self.create_random_name('job', 24) self.kwargs.update({ - 'job_name': job_name, - 'storage_account_1': storage_account_1, - 'storage_account_2': storage_account_2 + 'myJob': 'SdkJob952', + 'myJob2': 'SdkJob1735', + 'myJob3': 'SdkJob6429', + 'myJob4': 'SdkJob9640', + 'myJob5': 'SdkJob6599', + 'myJob6': 'SdkJob5337', + 'myJob7': 'SdkJob2965', + 'myJob8': 'TJ-636646322037905056', }) - # Create a databox job with sku 'DataBox'. - self.cmd('databox job create ' - '--resource-group {rg} ' - '--name {job_name} ' - '--location westus ' - '--sku DataBox ' - '--contact-name "Public SDK Test" ' - '--phone 14258828080 ' - '--email-list testing@microsoft.com ' - '--street-address1 "1 MICROSOFT WAY" ' - '--city Redmond ' - '--state-or-province WA ' - '--country US ' - '--postal-code 98052 ' - '--company-name Microsoft ' - '--storage-account {storage_account_1} {storage_account_2} ' - '--staging-storage-account {storage_account_1} ' - '--resource-group-for-managed-disk rg-for-managed-disk', - checks=[JMESPathCheck('status', 'DeviceOrdered')]) - - self.cmd('databox job update ' - '--resource-group {rg} ' - '--name {job_name} ' - '--contact-name "Public SDK Test 1" ' - '--email-list testing1@microsoft.com', - checks=[]) - - self.cmd('databox job show ' - '--resource-group {rg} ' - '--name {job_name}', - checks=[ - JMESPathCheck('name', job_name), - JMESPathCheck('isCancellable', True), - JMESPathCheck('isDeletable', False), - JMESPathCheck('details.contactDetails.contactName', 'Public SDK Test 1'), - JMESPathCheck('details.contactDetails.emailList[0]', 'testing1@microsoft.com')]) - - self.cmd('databox job list ' - '--resource-group {rg}', - checks=[JMESPathCheck('length(@)', 1)]) - - self.cmd('databox job cancel ' - '--resource-group {rg} ' - '--name {job_name} ' - '--reason "CancelTest" ' - '-y', - checks=[]) - - self.cmd('databox job show ' - '--resource-group {rg} ' - '--name {job_name}', - checks=[ - JMESPathCheck('name', job_name), - JMESPathCheck('isCancellable', False), - JMESPathCheck('isDeletable', True)]) - - self.cmd('databox job delete ' - '--resource-group {rg} ' - '--name {job_name} ' - '-y', - checks=[]) - - self.cmd('databox job show ' - '--resource-group {rg} ' - '--name {job_name}', - expect_failure=True) - - # Create another databox job with sku 'DataBoxDisk'. - self.cmd('databox job create ' - '--resource-group {rg} ' - '--name {job_name} ' - '--location westus ' - '--sku DataBoxDisk ' - '--expected-data-size 1 ' - '--contact-name "Public SDK Test" ' - '--phone 14258828080 ' - '--email-list testing@microsoft.com ' - '--street-address1 "1 MICROSOFT WAY" ' - '--city Redmond ' - '--state-or-province WA ' - '--country US ' - '--postal-code 98052 ' - '--company-name Microsoft ' - '--storage-account {storage_account_1}', - checks=[JMESPathCheck('status', 'DeviceOrdered')]) - - self.cmd('databox job cancel ' - '--resource-group {rg} ' - '--name {job_name} ' - '--reason "CancelTest" ' - '-y', - checks=[]) - - self.cmd('databox job delete ' - '--resource-group {rg} ' - '--name {job_name} ' - '-y', - checks=[]) - - self.cmd('databox job show ' - '--resource-group {rg} ' - '--name {job_name}', - expect_failure=True) - - # DataBox service will create a lock 'DATABOX_SERVICE' on the storage account under the resource group when creating a job. In order to clean up the resource group, we need delete the lock first. - self.cmd('lock delete ' - '--name DATABOX_SERVICE ' - '-g {rg} ' - '--resource-name {storage_account_1} ' - '--resource-type Microsoft.Storage/storageAccounts') - - self.cmd('lock delete ' - '--name DATABOX_SERVICE ' - '-g {rg} ' - '--resource-name {storage_account_2} ' - '--resource-type Microsoft.Storage/storageAccounts') + call_scenario(self, rg_4, rg_5, rg_8, rg, rg_2, rg_3, rg_6, rg_7, rg_9, rg_10, rg_11, rg_12, rg_13) + calc_coverage(__file__) + raise_if() diff --git a/src/databox/azext_databox/vendored_sdks/__init__.py b/src/databox/azext_databox/vendored_sdks/__init__.py index 7183870ee56..c9cfdc73e77 100644 --- a/src/databox/azext_databox/vendored_sdks/__init__.py +++ b/src/databox/azext_databox/vendored_sdks/__init__.py @@ -1,6 +1,12 @@ -# -------------------------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/databox/azext_databox/vendored_sdks/databox/__init__.py b/src/databox/azext_databox/vendored_sdks/databox/__init__.py index 1c85885ae27..f2d0b24d67c 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/__init__.py +++ b/src/databox/azext_databox/vendored_sdks/databox/__init__.py @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import DataBoxManagementClientConfiguration from ._data_box_management_client import DataBoxManagementClient -__all__ = ['DataBoxManagementClient', 'DataBoxManagementClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['DataBoxManagementClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/databox/azext_databox/vendored_sdks/databox/_configuration.py b/src/databox/azext_databox/vendored_sdks/databox/_configuration.py index adf67e024e2..c88976ea32f 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/_configuration.py +++ b/src/databox/azext_databox/vendored_sdks/databox/_configuration.py @@ -1,48 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class DataBoxManagementClientConfiguration(Configuration): + """Configuration for DataBoxManagementClient. -class DataBoxManagementClientConfiguration(AzureConfiguration): - """Configuration for DataBoxManagementClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The Subscription Id + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription Id. :type subscription_id: str - :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - super(DataBoxManagementClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-databox/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2020-11-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'databoxmanagementclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/databox/azext_databox/vendored_sdks/databox/_data_box_management_client.py b/src/databox/azext_databox/vendored_sdks/databox/_data_box_management_client.py index 7c2f11f5e82..cf0a1af4c0f 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/_data_box_management_client.py +++ b/src/databox/azext_databox/vendored_sdks/databox/_data_box_management_client.py @@ -1,59 +1,79 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations +from .operations import OperationOperations +from .operations import JobOperations from .operations import ServiceOperations from . import models -class DataBoxManagementClient(SDKClient): - """DataBoxManagementClient - - :ivar config: Configuration for client. - :vartype config: DataBoxManagementClientConfiguration - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.operations.Operations - :ivar jobs: Jobs operations - :vartype jobs: azure.mgmt.databox.operations.JobsOperations - :ivar service: Service operations - :vartype service: azure.mgmt.databox.operations.ServiceOperations +class DataBoxManagementClient(object): + """DataBoxManagementClient. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The Subscription Id + :ivar operation: OperationOperations operations + :vartype operation: data_box_management_client.operations.OperationOperations + :ivar job: JobOperations operations + :vartype job: data_box_management_client.operations.JobOperations + :ivar service: ServiceOperations operations + :vartype service: data_box_management_client.operations.ServiceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription Id. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = DataBoxManagementClientConfiguration(credentials, subscription_id, base_url) - super(DataBoxManagementClient, self).__init__(self.config.credentials, self.config) + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-09-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.jobs = JobsOperations( - self._client, self.config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job = JobOperations( + self._client, self._config, self._serialize, self._deserialize) self.service = ServiceOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataBoxManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/__init__.py b/src/databox/azext_databox/vendored_sdks/databox/aio/__init__.py new file mode 100644 index 00000000000..bb6b75a72db --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from ._data_box_management_client import DataBoxManagementClient +__all__ = ['DataBoxManagementClient'] diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/_configuration.py b/src/databox/azext_databox/vendored_sdks/databox/aio/_configuration.py new file mode 100644 index 00000000000..fd03ebc76bc --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class DataBoxManagementClientConfiguration(Configuration): + """Configuration for DataBoxManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-11-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'databoxmanagementclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/_data_box_management_client.py b/src/databox/azext_databox/vendored_sdks/databox/aio/_data_box_management_client.py new file mode 100644 index 00000000000..0ea29761c62 --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/_data_box_management_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import DataBoxManagementClientConfiguration +from .operations import OperationOperations +from .operations import JobOperations +from .operations import ServiceOperations +from .. import models + + +class DataBoxManagementClient(object): + """DataBoxManagementClient. + + :ivar operation: OperationOperations operations + :vartype operation: data_box_management_client.aio.operations.OperationOperations + :ivar job: JobOperations operations + :vartype job: data_box_management_client.aio.operations.JobOperations + :ivar service: ServiceOperations operations + :vartype service: data_box_management_client.aio.operations.ServiceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job = JobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service = ServiceOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "DataBoxManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/operations/__init__.py b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/__init__.py new file mode 100644 index 00000000000..dfc73af8ef4 --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from ._operation_operations import OperationOperations +from ._job_operations import JobOperations +from ._service_operations import ServiceOperations + +__all__ = [ + 'OperationOperations', + 'JobOperations', + 'ServiceOperations', +] diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_job_operations.py b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_job_operations.py new file mode 100644 index 00000000000..4a3203190ac --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_job_operations.py @@ -0,0 +1,972 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobOperations: + """JobOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.JobResourceList"]: + """Lists all the jobs available under the subscription. + + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_management_client.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.JobResourceList"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_management_client.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + + async def get( + self, + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "models.JobResource": + """Gets information about the specified job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param expand: $expand is supported on details parameter for job, which provides details on the + job stages. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~data_box_management_client.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + job_name: str, + location: str, + sku: "models.Sku", + transfer_type: Union[str, "models.TransferType"], + tags: Optional[Dict[str, str]] = None, + type: Optional[str] = None, + user_assigned_identities: Optional[Dict[str, "models.UserAssignedIdentity"]] = None, + details: Optional["models.JobDetails"] = None, + delivery_type: Optional[Union[str, "models.JobDeliveryType"]] = None, + scheduled_date_time: Optional[datetime.datetime] = None, + **kwargs + ) -> Optional["models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + job_resource = models.JobResource(location=location, tags=tags, sku=sku, type=type, user_assigned_identities=user_assigned_identities, transfer_type=transfer_type, details=details, delivery_type=delivery_type, scheduled_date_time=scheduled_date_time) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(job_resource, 'JobResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + job_name: str, + location: str, + sku: "models.Sku", + transfer_type: Union[str, "models.TransferType"], + tags: Optional[Dict[str, str]] = None, + type: Optional[str] = None, + user_assigned_identities: Optional[Dict[str, "models.UserAssignedIdentity"]] = None, + details: Optional["models.JobDetails"] = None, + delivery_type: Optional[Union[str, "models.JobDeliveryType"]] = None, + scheduled_date_time: Optional[datetime.datetime] = None, + **kwargs + ) -> AsyncLROPoller["models.JobResource"]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param location: The location of the resource. This will be one of the supported and registered + Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be + changed once it is created, but if an identical region is specified on update the request will + succeed. + :type location: str + :param sku: The sku type. + :type sku: ~data_box_management_client.models.Sku + :param transfer_type: Type of the data transfer. + :type transfer_type: str or ~data_box_management_client.models.TransferType + :param tags: The list of key value pairs that describe the resource. These tags can be used in + viewing and grouping this resource (across resource groups). + :type tags: dict[str, str] + :param type: Identity type. + :type type: str + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, ~data_box_management_client.models.UserAssignedIdentity] + :param details: Details of a job run. This field will only be sent for expand details filter. + :type details: ~data_box_management_client.models.JobDetails + :param delivery_type: Delivery type of Job. + :type delivery_type: str or ~data_box_management_client.models.JobDeliveryType + :param scheduled_date_time: Scheduled date time. + :type scheduled_date_time: ~datetime.datetime + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_management_client.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + location=location, + sku=sku, + transfer_type=transfer_type, + tags=tags, + type=type, + user_assigned_identities=user_assigned_identities, + details=details, + delivery_type=delivery_type, + scheduled_date_time=scheduled_date_time, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + job_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + job_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + job_name=job_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + job_name: str, + if_match: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + shipping_address: Optional["models.ShippingAddress"] = None, + kek_type: Optional[Union[str, "models.KekType"]] = None, + kek_url: Optional[str] = None, + kek_vault_resource_id: Optional[str] = None, + type: Optional[str] = None, + user_assigned: Optional["models.UserAssignedProperties"] = None, + contact_name: Optional[str] = None, + phone: Optional[str] = None, + phone_extension: Optional[str] = None, + mobile: Optional[str] = None, + email_list: Optional[List[str]] = None, + notification_preference: Optional[List["models.NotificationPreference"]] = None, + user_assigned_identities: Optional[Dict[str, "models.UserAssignedIdentity"]] = None, + **kwargs + ) -> Optional["models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + job_resource_update_parameter = models.JobResourceUpdateParameter(tags=tags, shipping_address=shipping_address, kek_type=kek_type, kek_url=kek_url, kek_vault_resource_id=kek_vault_resource_id, type_details_key_encryption_key_identity_properties_type=type, user_assigned=user_assigned, contact_name=contact_name, phone=phone, phone_extension=phone_extension, mobile=mobile, email_list=email_list, notification_preference=notification_preference, user_assigned_identities=user_assigned_identities) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + job_name: str, + if_match: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + shipping_address: Optional["models.ShippingAddress"] = None, + kek_type: Optional[Union[str, "models.KekType"]] = None, + kek_url: Optional[str] = None, + kek_vault_resource_id: Optional[str] = None, + type: Optional[str] = None, + user_assigned: Optional["models.UserAssignedProperties"] = None, + contact_name: Optional[str] = None, + phone: Optional[str] = None, + phone_extension: Optional[str] = None, + mobile: Optional[str] = None, + email_list: Optional[List[str]] = None, + notification_preference: Optional[List["models.NotificationPreference"]] = None, + user_assigned_identities: Optional[Dict[str, "models.UserAssignedIdentity"]] = None, + **kwargs + ) -> AsyncLROPoller["models.JobResource"]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the job on the server matches this value. + :type if_match: str + :param tags: The list of key value pairs that describe the resource. These tags can be used in + viewing and grouping this resource (across resource groups). + :type tags: dict[str, str] + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param kek_type: Type of encryption key used for key encryption. + :type kek_type: str or ~data_box_management_client.models.KekType + :param kek_url: Key encryption key. It is required in case of Customer managed KekType. + :type kek_url: str + :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + KekType. + :type kek_vault_resource_id: str + :param type: Managed service identity type. + :type type: str + :param user_assigned: User assigned identity properties. + :type user_assigned: ~data_box_management_client.models.UserAssignedProperties + :param contact_name: Contact name of the person. + :type contact_name: str + :param phone: Phone number of the contact person. + :type phone: str + :param phone_extension: Phone extension number of the contact person. + :type phone_extension: str + :param mobile: Mobile number of the contact person. + :type mobile: str + :param email_list: List of Email-ids to be notified about job progress. + :type email_list: list[str] + :param notification_preference: Notification preference for a job stage. + :type notification_preference: list[~data_box_management_client.models.NotificationPreference] + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, ~data_box_management_client.models.UserAssignedIdentity] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_management_client.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + if_match=if_match, + tags=tags, + shipping_address=shipping_address, + kek_type=kek_type, + kek_url=kek_url, + kek_vault_resource_id=kek_vault_resource_id, + type=type, + user_assigned=user_assigned, + contact_name=contact_name, + phone=phone, + phone_extension=phone_extension, + mobile=mobile, + email_list=email_list, + notification_preference=notification_preference, + user_assigned_identities=user_assigned_identities, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + start_time: datetime.datetime, + end_time: datetime.datetime, + shipment_location: str, + **kwargs + ) -> "models.ShipmentPickUpResponse": + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param start_time: Minimum date after which the pick up should commence, this must be in local + time of pick up area. + :type start_time: ~datetime.datetime + :param end_time: Maximum date before which the pick up should commence, this must be in local + time of pick up area. + :type end_time: ~datetime.datetime + :param shipment_location: Shipment Location in the pickup place. Eg.front desk. + :type shipment_location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShipmentPickUpResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ShipmentPickUpResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShipmentPickUpResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + shipment_pick_up_request = models.ShipmentPickUpRequest(start_time=start_time, end_time=end_time, shipment_location=shipment_location) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.book_shipment_pick_up.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + async def cancel( + self, + resource_group_name: str, + job_name: str, + reason: str, + **kwargs + ) -> None: + """CancelJob. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param reason: Reason for cancellation. + :type reason: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + cancellation_reason = models.CancellationReason(reason=reason) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.cancel.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(cancellation_reason, 'CancellationReason') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + def list_credentials( + self, + resource_group_name: str, + job_name: str, + **kwargs + ) -> AsyncIterable["models.UnencryptedCredentialsList"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_management_client.models.UnencryptedCredentialsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UnencryptedCredentialsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_operation_operations.py b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_operation_operations.py new file mode 100644 index 00000000000..2d696f72633 --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_operation_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.OperationList"]: + """This method gets all the operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_management_client.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_service_operations.py b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_service_operations.py new file mode 100644 index 00000000000..dcb3d1aca19 --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/aio/operations/_service_operations.py @@ -0,0 +1,390 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ServiceOperations: + """ServiceOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def validate_address( + self, + location: str, + validation_type: Union[str, "models.ValidationInputDiscriminator"], + shipping_address: "models.ShippingAddress", + device_type: Union[str, "models.SkuName"], + preferred_shipment_type: Optional[Union[str, "models.TransportShipmentTypes"]] = None, + **kwargs + ) -> "models.AddressValidationOutput": + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The location of the resource. + :type location: str + :param validation_type: Identifies the type of validation request. + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param device_type: Device type to be used for the job. + :type device_type: str or ~data_box_management_client.models.SkuName + :param preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. + :type preferred_shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressValidationOutput, or the result of cls(response) + :rtype: ~data_box_management_client.models.AddressValidationOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AddressValidationOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + validate_address = models.ValidateAddress(validation_type=validation_type, shipping_address=shipping_address, device_type=device_type, preferred_shipment_type=preferred_shipment_type) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_address.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_address, 'ValidateAddress') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AddressValidationOutput', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + + async def validate_input_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: "models.ValidationRequest", + **kwargs + ) -> "models.ValidationResponse": + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~data_box_management_client.models.ValidationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_input_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validation_request, 'ValidationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate_input_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + async def validate_input( + self, + location: str, + validation_request: "models.ValidationRequest", + **kwargs + ) -> "models.ValidationResponse": + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~data_box_management_client.models.ValidationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_input.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validation_request, 'ValidationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate_input.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + async def region_configuration( + self, + location: str, + schedule_availability_request: Optional["models.ScheduleAvailabilityRequest"] = None, + sku_name: Optional[Union[str, "models.SkuName"]] = None, + **kwargs + ) -> "models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. + :type location: str + :param schedule_availability_request: Request body to get the availability for scheduling + orders. + :type schedule_availability_request: ~data_box_management_client.models.ScheduleAvailabilityRequest + :param sku_name: Type of the device. + :type sku_name: str or ~data_box_management_client.models.SkuName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegionConfigurationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + region_configuration_request = models.RegionConfigurationRequest(schedule_availability_request=schedule_availability_request, sku_name=sku_name) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.region_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + schedule_availability_request: Optional["models.ScheduleAvailabilityRequest"] = None, + sku_name: Optional[Union[str, "models.SkuName"]] = None, + **kwargs + ) -> "models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param schedule_availability_request: Request body to get the availability for scheduling + orders. + :type schedule_availability_request: ~data_box_management_client.models.ScheduleAvailabilityRequest + :param sku_name: Type of the device. + :type sku_name: str or ~data_box_management_client.models.SkuName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegionConfigurationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + region_configuration_request = models.RegionConfigurationRequest(schedule_availability_request=schedule_availability_request, sku_name=sku_name) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/models/__init__.py b/src/databox/azext_databox/vendored_sdks/databox/models/__init__.py index ade07b1ec9a..8e51f35e1a9 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/models/__init__.py +++ b/src/databox/azext_databox/vendored_sdks/databox/models/__init__.py @@ -1,27 +1,32 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- try: from ._models_py3 import AccountCredentialDetails + from ._models_py3 import AdditionalErrorInfo from ._models_py3 import AddressValidationOutput + from ._models_py3 import AddressValidationProperties + from ._models_py3 import ApiError from ._models_py3 import ApplianceNetworkConfiguration from ._models_py3 import ArmBaseObject from ._models_py3 import AvailableSkuRequest + from ._models_py3 import AvailableSkusResult + from ._models_py3 import AzureFileFilterDetails + from ._models_py3 import BlobFilterDetails from ._models_py3 import CancellationReason + from ._models_py3 import CloudError from ._models_py3 import ContactDetails from ._models_py3 import CopyLogDetails from ._models_py3 import CopyProgress from ._models_py3 import CreateJobValidations from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties + from ._models_py3 import DataAccountDetails from ._models_py3 import DataBoxAccountCopyLogDetails from ._models_py3 import DataBoxDiskCopyLogDetails from ._models_py3 import DataBoxDiskCopyProgress @@ -32,30 +37,34 @@ from ._models_py3 import DataBoxHeavyJobSecrets from ._models_py3 import DataBoxHeavySecret from ._models_py3 import DataBoxJobDetails - from ._models_py3 import DataboxJobSecrets from ._models_py3 import DataBoxScheduleAvailabilityRequest from ._models_py3 import DataBoxSecret - from ._models_py3 import DataDestinationDetailsValidationRequest - from ._models_py3 import DataDestinationDetailsValidationResponseProperties + from ._models_py3 import DataExportDetails + from ._models_py3 import DataImportDetails + from ._models_py3 import DataLocationToServiceLocationMap + from ._models_py3 import DataTransferDetailsValidationRequest + from ._models_py3 import DataTransferDetailsValidationResponseProperties + from ._models_py3 import DataboxJobSecrets from ._models_py3 import DcAccessSecurityCode - from ._models_py3 import DestinationAccountDetails - from ._models_py3 import DestinationManagedDiskDetails - from ._models_py3 import DestinationStorageAccountDetails - from ._models_py3 import DestinationToServiceLocationMap + from ._models_py3 import Details from ._models_py3 import DiskScheduleAvailabilityRequest from ._models_py3 import DiskSecret - from ._models_py3 import Error + from ._models_py3 import EncryptionPreferences + from ._models_py3 import ErrorDetail + from ._models_py3 import FilterFileDetails from ._models_py3 import HeavyScheduleAvailabilityRequest - from ._models_py3 import JobDeliveryInfo from ._models_py3 import JobDetails - from ._models_py3 import JobErrorDetails from ._models_py3 import JobResource + from ._models_py3 import JobResourceList from ._models_py3 import JobResourceUpdateParameter from ._models_py3 import JobSecrets from ._models_py3 import JobStages + from ._models_py3 import KeyEncryptionKey + from ._models_py3 import ManagedDiskDetails from ._models_py3 import NotificationPreference from ._models_py3 import Operation from ._models_py3 import OperationDisplay + from ._models_py3 import OperationList from ._models_py3 import PackageShippingDetails from ._models_py3 import Preferences from ._models_py3 import PreferencesValidationRequest @@ -75,133 +84,172 @@ from ._models_py3 import SkuCapacity from ._models_py3 import SkuCost from ._models_py3 import SkuInformation + from ._models_py3 import StorageAccountDetails from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties + from ._models_py3 import TransferAllDetails + from ._models_py3 import TransferConfiguration + from ._models_py3 import TransferConfigurationTransferAllDetails + from ._models_py3 import TransferConfigurationTransferFilterDetails + from ._models_py3 import TransferFilterDetails from ._models_py3 import TransportAvailabilityDetails - from ._models_py3 import TransportAvailabilityRequest from ._models_py3 import TransportAvailabilityResponse from ._models_py3 import TransportPreferences from ._models_py3 import UnencryptedCredentials - from ._models_py3 import UpdateJobDetails + from ._models_py3 import UnencryptedCredentialsList + from ._models_py3 import UserAssignedIdentity + from ._models_py3 import UserAssignedProperties from ._models_py3 import ValidateAddress from ._models_py3 import ValidationInputRequest from ._models_py3 import ValidationInputResponse from ._models_py3 import ValidationRequest from ._models_py3 import ValidationResponse except (SyntaxError, ImportError): - from ._models import AccountCredentialDetails - from ._models import AddressValidationOutput - from ._models import ApplianceNetworkConfiguration - from ._models import ArmBaseObject - from ._models import AvailableSkuRequest - from ._models import CancellationReason - from ._models import ContactDetails - from ._models import CopyLogDetails - from ._models import CopyProgress - from ._models import CreateJobValidations - from ._models import CreateOrderLimitForSubscriptionValidationRequest - from ._models import CreateOrderLimitForSubscriptionValidationResponseProperties - from ._models import DataBoxAccountCopyLogDetails - from ._models import DataBoxDiskCopyLogDetails - from ._models import DataBoxDiskCopyProgress - from ._models import DataBoxDiskJobDetails - from ._models import DataBoxDiskJobSecrets - from ._models import DataBoxHeavyAccountCopyLogDetails - from ._models import DataBoxHeavyJobDetails - from ._models import DataBoxHeavyJobSecrets - from ._models import DataBoxHeavySecret - from ._models import DataBoxJobDetails - from ._models import DataboxJobSecrets - from ._models import DataBoxScheduleAvailabilityRequest - from ._models import DataBoxSecret - from ._models import DataDestinationDetailsValidationRequest - from ._models import DataDestinationDetailsValidationResponseProperties - from ._models import DcAccessSecurityCode - from ._models import DestinationAccountDetails - from ._models import DestinationManagedDiskDetails - from ._models import DestinationStorageAccountDetails - from ._models import DestinationToServiceLocationMap - from ._models import DiskScheduleAvailabilityRequest - from ._models import DiskSecret - from ._models import Error - from ._models import HeavyScheduleAvailabilityRequest - from ._models import JobDeliveryInfo - from ._models import JobDetails - from ._models import JobErrorDetails - from ._models import JobResource - from ._models import JobResourceUpdateParameter - from ._models import JobSecrets - from ._models import JobStages - from ._models import NotificationPreference - from ._models import Operation - from ._models import OperationDisplay - from ._models import PackageShippingDetails - from ._models import Preferences - from ._models import PreferencesValidationRequest - from ._models import PreferencesValidationResponseProperties - from ._models import RegionConfigurationRequest - from ._models import RegionConfigurationResponse - from ._models import Resource - from ._models import ScheduleAvailabilityRequest - from ._models import ScheduleAvailabilityResponse - from ._models import ShareCredentialDetails - from ._models import ShipmentPickUpRequest - from ._models import ShipmentPickUpResponse - from ._models import ShippingAddress - from ._models import Sku - from ._models import SkuAvailabilityValidationRequest - from ._models import SkuAvailabilityValidationResponseProperties - from ._models import SkuCapacity - from ._models import SkuCost - from ._models import SkuInformation - from ._models import SubscriptionIsAllowedToCreateJobValidationRequest - from ._models import SubscriptionIsAllowedToCreateJobValidationResponseProperties - from ._models import TransportAvailabilityDetails - from ._models import TransportAvailabilityRequest - from ._models import TransportAvailabilityResponse - from ._models import TransportPreferences - from ._models import UnencryptedCredentials - from ._models import UpdateJobDetails - from ._models import ValidateAddress - from ._models import ValidationInputRequest - from ._models import ValidationInputResponse - from ._models import ValidationRequest - from ._models import ValidationResponse -from ._paged_models import JobResourcePaged -from ._paged_models import OperationPaged -from ._paged_models import SkuInformationPaged -from ._paged_models import UnencryptedCredentialsPaged + from ._models import AccountCredentialDetails # type: ignore + from ._models import AdditionalErrorInfo # type: ignore + from ._models import AddressValidationOutput # type: ignore + from ._models import AddressValidationProperties # type: ignore + from ._models import ApiError # type: ignore + from ._models import ApplianceNetworkConfiguration # type: ignore + from ._models import ArmBaseObject # type: ignore + from ._models import AvailableSkuRequest # type: ignore + from ._models import AvailableSkusResult # type: ignore + from ._models import AzureFileFilterDetails # type: ignore + from ._models import BlobFilterDetails # type: ignore + from ._models import CancellationReason # type: ignore + from ._models import CloudError # type: ignore + from ._models import ContactDetails # type: ignore + from ._models import CopyLogDetails # type: ignore + from ._models import CopyProgress # type: ignore + from ._models import CreateJobValidations # type: ignore + from ._models import CreateOrderLimitForSubscriptionValidationRequest # type: ignore + from ._models import CreateOrderLimitForSubscriptionValidationResponseProperties # type: ignore + from ._models import DataAccountDetails # type: ignore + from ._models import DataBoxAccountCopyLogDetails # type: ignore + from ._models import DataBoxDiskCopyLogDetails # type: ignore + from ._models import DataBoxDiskCopyProgress # type: ignore + from ._models import DataBoxDiskJobDetails # type: ignore + from ._models import DataBoxDiskJobSecrets # type: ignore + from ._models import DataBoxHeavyAccountCopyLogDetails # type: ignore + from ._models import DataBoxHeavyJobDetails # type: ignore + from ._models import DataBoxHeavyJobSecrets # type: ignore + from ._models import DataBoxHeavySecret # type: ignore + from ._models import DataBoxJobDetails # type: ignore + from ._models import DataBoxScheduleAvailabilityRequest # type: ignore + from ._models import DataBoxSecret # type: ignore + from ._models import DataExportDetails # type: ignore + from ._models import DataImportDetails # type: ignore + from ._models import DataLocationToServiceLocationMap # type: ignore + from ._models import DataTransferDetailsValidationRequest # type: ignore + from ._models import DataTransferDetailsValidationResponseProperties # type: ignore + from ._models import DataboxJobSecrets # type: ignore + from ._models import DcAccessSecurityCode # type: ignore + from ._models import Details # type: ignore + from ._models import DiskScheduleAvailabilityRequest # type: ignore + from ._models import DiskSecret # type: ignore + from ._models import EncryptionPreferences # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import FilterFileDetails # type: ignore + from ._models import HeavyScheduleAvailabilityRequest # type: ignore + from ._models import JobDetails # type: ignore + from ._models import JobResource # type: ignore + from ._models import JobResourceList # type: ignore + from ._models import JobResourceUpdateParameter # type: ignore + from ._models import JobSecrets # type: ignore + from ._models import JobStages # type: ignore + from ._models import KeyEncryptionKey # type: ignore + from ._models import ManagedDiskDetails # type: ignore + from ._models import NotificationPreference # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationList # type: ignore + from ._models import PackageShippingDetails # type: ignore + from ._models import Preferences # type: ignore + from ._models import PreferencesValidationRequest # type: ignore + from ._models import PreferencesValidationResponseProperties # type: ignore + from ._models import RegionConfigurationRequest # type: ignore + from ._models import RegionConfigurationResponse # type: ignore + from ._models import Resource # type: ignore + from ._models import ScheduleAvailabilityRequest # type: ignore + from ._models import ScheduleAvailabilityResponse # type: ignore + from ._models import ShareCredentialDetails # type: ignore + from ._models import ShipmentPickUpRequest # type: ignore + from ._models import ShipmentPickUpResponse # type: ignore + from ._models import ShippingAddress # type: ignore + from ._models import Sku # type: ignore + from ._models import SkuAvailabilityValidationRequest # type: ignore + from ._models import SkuAvailabilityValidationResponseProperties # type: ignore + from ._models import SkuCapacity # type: ignore + from ._models import SkuCost # type: ignore + from ._models import SkuInformation # type: ignore + from ._models import StorageAccountDetails # type: ignore + from ._models import SubscriptionIsAllowedToCreateJobValidationRequest # type: ignore + from ._models import SubscriptionIsAllowedToCreateJobValidationResponseProperties # type: ignore + from ._models import TransferAllDetails # type: ignore + from ._models import TransferConfiguration # type: ignore + from ._models import TransferConfigurationTransferAllDetails # type: ignore + from ._models import TransferConfigurationTransferFilterDetails # type: ignore + from ._models import TransferFilterDetails # type: ignore + from ._models import TransportAvailabilityDetails # type: ignore + from ._models import TransportAvailabilityResponse # type: ignore + from ._models import TransportPreferences # type: ignore + from ._models import UnencryptedCredentials # type: ignore + from ._models import UnencryptedCredentialsList # type: ignore + from ._models import UserAssignedIdentity # type: ignore + from ._models import UserAssignedProperties # type: ignore + from ._models import ValidateAddress # type: ignore + from ._models import ValidationInputRequest # type: ignore + from ._models import ValidationInputResponse # type: ignore + from ._models import ValidationRequest # type: ignore + from ._models import ValidationResponse # type: ignore + from ._data_box_management_client_enums import ( - DataDestinationType, - ShareDestinationFormatType, AccessProtocol, - AddressValidationStatus, AddressType, - SkuName, - SkuDisabledReason, - NotificationStageName, - ValidationStatus, + AddressValidationStatus, + ClassDiscriminator, CopyStatus, + DataAccountType, + DoubleEncryption, + FilterFileType, + JobDeliveryType, + KekType, + LogCollectionLevel, + NotificationStageName, + OverallValidationStatus, + ShareDestinationFormatType, + SkuDisabledReason, + SkuName, StageName, StageStatus, + TransferConfigurationType, + TransferType, TransportShipmentTypes, - JobDeliveryType, - OverallValidationStatus, + ValidationInputDiscriminator, + ValidationStatus, ) __all__ = [ 'AccountCredentialDetails', + 'AdditionalErrorInfo', 'AddressValidationOutput', + 'AddressValidationProperties', + 'ApiError', 'ApplianceNetworkConfiguration', 'ArmBaseObject', 'AvailableSkuRequest', + 'AvailableSkusResult', + 'AzureFileFilterDetails', + 'BlobFilterDetails', 'CancellationReason', + 'CloudError', 'ContactDetails', 'CopyLogDetails', 'CopyProgress', 'CreateJobValidations', 'CreateOrderLimitForSubscriptionValidationRequest', 'CreateOrderLimitForSubscriptionValidationResponseProperties', + 'DataAccountDetails', 'DataBoxAccountCopyLogDetails', 'DataBoxDiskCopyLogDetails', 'DataBoxDiskCopyProgress', @@ -212,30 +260,34 @@ 'DataBoxHeavyJobSecrets', 'DataBoxHeavySecret', 'DataBoxJobDetails', - 'DataboxJobSecrets', 'DataBoxScheduleAvailabilityRequest', 'DataBoxSecret', - 'DataDestinationDetailsValidationRequest', - 'DataDestinationDetailsValidationResponseProperties', + 'DataExportDetails', + 'DataImportDetails', + 'DataLocationToServiceLocationMap', + 'DataTransferDetailsValidationRequest', + 'DataTransferDetailsValidationResponseProperties', + 'DataboxJobSecrets', 'DcAccessSecurityCode', - 'DestinationAccountDetails', - 'DestinationManagedDiskDetails', - 'DestinationStorageAccountDetails', - 'DestinationToServiceLocationMap', + 'Details', 'DiskScheduleAvailabilityRequest', 'DiskSecret', - 'Error', + 'EncryptionPreferences', + 'ErrorDetail', + 'FilterFileDetails', 'HeavyScheduleAvailabilityRequest', - 'JobDeliveryInfo', 'JobDetails', - 'JobErrorDetails', 'JobResource', + 'JobResourceList', 'JobResourceUpdateParameter', 'JobSecrets', 'JobStages', + 'KeyEncryptionKey', + 'ManagedDiskDetails', 'NotificationPreference', 'Operation', 'OperationDisplay', + 'OperationList', 'PackageShippingDetails', 'Preferences', 'PreferencesValidationRequest', @@ -255,36 +307,47 @@ 'SkuCapacity', 'SkuCost', 'SkuInformation', + 'StorageAccountDetails', 'SubscriptionIsAllowedToCreateJobValidationRequest', 'SubscriptionIsAllowedToCreateJobValidationResponseProperties', + 'TransferAllDetails', + 'TransferConfiguration', + 'TransferConfigurationTransferAllDetails', + 'TransferConfigurationTransferFilterDetails', + 'TransferFilterDetails', 'TransportAvailabilityDetails', - 'TransportAvailabilityRequest', 'TransportAvailabilityResponse', 'TransportPreferences', 'UnencryptedCredentials', - 'UpdateJobDetails', + 'UnencryptedCredentialsList', + 'UserAssignedIdentity', + 'UserAssignedProperties', 'ValidateAddress', 'ValidationInputRequest', 'ValidationInputResponse', 'ValidationRequest', 'ValidationResponse', - 'OperationPaged', - 'JobResourcePaged', - 'UnencryptedCredentialsPaged', - 'SkuInformationPaged', - 'DataDestinationType', - 'ShareDestinationFormatType', 'AccessProtocol', - 'AddressValidationStatus', 'AddressType', - 'SkuName', - 'SkuDisabledReason', - 'NotificationStageName', - 'ValidationStatus', + 'AddressValidationStatus', + 'ClassDiscriminator', 'CopyStatus', + 'DataAccountType', + 'DoubleEncryption', + 'FilterFileType', + 'JobDeliveryType', + 'KekType', + 'LogCollectionLevel', + 'NotificationStageName', + 'OverallValidationStatus', + 'ShareDestinationFormatType', + 'SkuDisabledReason', + 'SkuName', 'StageName', 'StageStatus', + 'TransferConfigurationType', + 'TransferType', 'TransportShipmentTypes', - 'JobDeliveryType', - 'OverallValidationStatus', + 'ValidationInputDiscriminator', + 'ValidationStatus', ] diff --git a/src/databox/azext_databox/vendored_sdks/databox/models/_data_box_management_client_enums.py b/src/databox/azext_databox/vendored_sdks/databox/models/_data_box_management_client_enums.py index 4cbea094a21..7d1d81567b8 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/models/_data_box_management_client_enums.py +++ b/src/databox/azext_databox/vendored_sdks/databox/models/_data_box_management_client_enums.py @@ -1,147 +1,237 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): -class DataDestinationType(str, Enum): - - storage_account = "StorageAccount" #: Storage Accounts . - managed_disk = "ManagedDisk" #: Azure Managed disk storage. - - -class ShareDestinationFormatType(str, Enum): - - unknown_type = "UnknownType" #: Unknown format. - hcs = "HCS" #: Storsimple data format. - block_blob = "BlockBlob" #: Azure storage block blob format. - page_blob = "PageBlob" #: Azure storage page blob format. - azure_file = "AzureFile" #: Azure storage file format. - managed_disk = "ManagedDisk" #: Azure Compute Disk. - - -class AccessProtocol(str, Enum): - - smb = "SMB" #: Server Message Block protocol(SMB). - nfs = "NFS" #: Network File System protocol(NFS). - - -class AddressValidationStatus(str, Enum): - - valid = "Valid" #: Address provided is valid. - invalid = "Invalid" #: Address provided is invalid or not supported. - ambiguous = "Ambiguous" #: Address provided is ambiguous, please choose one of the alternate addresses returned. - - -class AddressType(str, Enum): - - none = "None" #: Address type not known. - residential = "Residential" #: Residential Address. - commercial = "Commercial" #: Commercial Address. - - -class SkuName(str, Enum): - - data_box = "DataBox" #: Databox. - data_box_disk = "DataBoxDisk" #: DataboxDisk. - data_box_heavy = "DataBoxHeavy" #: DataboxHeavy. - - -class SkuDisabledReason(str, Enum): - - none = "None" #: SKU is not disabled. - country = "Country" #: SKU is not available in the requested country. - region = "Region" #: SKU is not available to push data to the requested Azure region. - feature = "Feature" #: Required features are not enabled for the SKU. - offer_type = "OfferType" #: Subscription does not have required offer types for the SKU. - no_subscription_info = "NoSubscriptionInfo" #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. - - -class NotificationStageName(str, Enum): - - device_prepared = "DevicePrepared" #: Notification at device prepared stage. - dispatched = "Dispatched" #: Notification at device dispatched stage. - delivered = "Delivered" #: Notification at device delivered stage. - picked_up = "PickedUp" #: Notification at device picked up from user stage. - at_azure_dc = "AtAzureDC" #: Notification at device received at azure datacenter stage. - data_copy = "DataCopy" #: Notification at data copy started stage. - - -class ValidationStatus(str, Enum): - - valid = "Valid" #: Validation is successful - invalid = "Invalid" #: Validation is not successful - skipped = "Skipped" #: Validation is skipped - - -class CopyStatus(str, Enum): - - not_started = "NotStarted" #: Data copy hasn't started yet. - in_progress = "InProgress" #: Data copy is in progress. - completed = "Completed" #: Data copy completed. - completed_with_errors = "CompletedWithErrors" #: Data copy completed with errors. - failed = "Failed" #: Data copy failed. No data was copied. - not_returned = "NotReturned" #: No copy triggered as device was not returned. - hardware_error = "HardwareError" #: The Device has hit hardware issues. - device_formatted = "DeviceFormatted" #: Data copy failed. The Device was formatted by user. - device_metadata_modified = "DeviceMetadataModified" #: Data copy failed. Device metadata was modified by user. - storage_account_not_accessible = "StorageAccountNotAccessible" #: Data copy failed. Storage Account was not accessible during copy. - unsupported_data = "UnsupportedData" #: Data copy failed. The Device data content is not supported. - - -class StageName(str, Enum): - - device_ordered = "DeviceOrdered" #: An order has been created. - device_prepared = "DevicePrepared" #: A device has been prepared for the order. - dispatched = "Dispatched" #: Device has been dispatched to the user of the order. - delivered = "Delivered" #: Device has been delivered to the user of the order. - picked_up = "PickedUp" #: Device has been picked up from user and in transit to azure datacenter. - at_azure_dc = "AtAzureDC" #: Device has been received at azure datacenter from the user. - data_copy = "DataCopy" #: Data copy from the device at azure datacenter. - completed = "Completed" #: Order has completed. - completed_with_errors = "CompletedWithErrors" #: Order has completed with errors. - cancelled = "Cancelled" #: Order has been cancelled. - failed_issue_reported_at_customer = "Failed_IssueReportedAtCustomer" #: Order has failed due to issue reported by user. - failed_issue_detected_at_azure_dc = "Failed_IssueDetectedAtAzureDC" #: Order has failed due to issue detected at azure datacenter. - aborted = "Aborted" #: Order has been aborted. - completed_with_warnings = "CompletedWithWarnings" #: Order has completed with warnings. - ready_to_dispatch_from_azure_dc = "ReadyToDispatchFromAzureDC" #: Device is ready to be handed to customer from Azure DC. - ready_to_receive_at_azure_dc = "ReadyToReceiveAtAzureDC" #: Device can be dropped off at Azure DC. - - -class StageStatus(str, Enum): - - none = "None" #: No status available yet. - in_progress = "InProgress" #: Stage is in progress. - succeeded = "Succeeded" #: Stage has succeeded. - failed = "Failed" #: Stage has failed. - cancelled = "Cancelled" #: Stage has been cancelled. - cancelling = "Cancelling" #: Stage is cancelling. - succeeded_with_errors = "SucceededWithErrors" #: Stage has succeeded with errors. - - -class TransportShipmentTypes(str, Enum): - - customer_managed = "CustomerManaged" #: Shipment Logistics is handled by the customer. - microsoft_managed = "MicrosoftManaged" #: Shipment Logistics is handled by Microsoft. - - -class JobDeliveryType(str, Enum): - - non_scheduled = "NonScheduled" #: Non Scheduled job. - scheduled = "Scheduled" #: Scheduled job. - - -class OverallValidationStatus(str, Enum): - - all_valid_to_proceed = "AllValidToProceed" #: Every input request is valid. - inputs_revisit_required = "InputsRevisitRequired" #: Some input requests are not valid. - certain_input_validations_skipped = "CertainInputValidationsSkipped" #: Certain input validations skipped. + SMB = "SMB" #: Server Message Block protocol(SMB). + NFS = "NFS" #: Network File System protocol(NFS). + +class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of address. + """ + + NONE = "None" #: Address type not known. + RESIDENTIAL = "Residential" #: Residential Address. + COMMERCIAL = "Commercial" #: Commercial Address. + +class AddressValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The address validation status. + """ + + VALID = "Valid" #: Address provided is valid. + INVALID = "Invalid" #: Address provided is invalid or not supported. + AMBIGUOUS = "Ambiguous" #: Address provided is ambiguous, please choose one of the alternate addresses returned. + +class ClassDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates the type of job details. + """ + + DATA_BOX = "DataBox" #: Data Box orders. + DATA_BOX_DISK = "DataBoxDisk" #: Data Box Disk orders. + DATA_BOX_HEAVY = "DataBoxHeavy" #: Data Box Heavy orders. + +class CopyStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Status of the copy + """ + + NOT_STARTED = "NotStarted" #: Data copy hasn't started yet. + IN_PROGRESS = "InProgress" #: Data copy is in progress. + COMPLETED = "Completed" #: Data copy completed. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Data copy completed with errors. + FAILED = "Failed" #: Data copy failed. No data was copied. + NOT_RETURNED = "NotReturned" #: No copy triggered as device was not returned. + HARDWARE_ERROR = "HardwareError" #: The Device has hit hardware issues. + DEVICE_FORMATTED = "DeviceFormatted" #: Data copy failed. The Device was formatted by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" #: Data copy failed. Device metadata was modified by user. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" #: Data copy failed. Storage Account was not accessible during copy. + UNSUPPORTED_DATA = "UnsupportedData" #: Data copy failed. The Device data content is not supported. + +class DataAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the account. + """ + + STORAGE_ACCOUNT = "StorageAccount" #: Storage Accounts . + MANAGED_DISK = "ManagedDisk" #: Azure Managed disk storage. + +class DoubleEncryption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines secondary layer of software-based encryption enablement. + """ + + ENABLED = "Enabled" #: Software-based encryption is enabled. + DISABLED = "Disabled" #: Software-based encryption is disabled. + +class FilterFileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the filter file. + """ + + AZURE_BLOB = "AzureBlob" #: Filter file is of the type AzureBlob. + AZURE_FILE = "AzureFile" #: Filter file is of the type AzureFiles. + +class JobDeliveryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Delivery type of Job. + """ + + NON_SCHEDULED = "NonScheduled" #: Non Scheduled job. + SCHEDULED = "Scheduled" #: Scheduled job. + +class KekType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of encryption key used for key encryption. + """ + + MICROSOFT_MANAGED = "MicrosoftManaged" #: Key encryption key is managed by Microsoft. + CUSTOMER_MANAGED = "CustomerManaged" #: Key encryption key is managed by the Customer. + +class LogCollectionLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Level of the logs to be collected. + """ + + ERROR = "Error" #: Only Errors will be collected in the logs. + VERBOSE = "Verbose" #: Verbose logging (includes Errors, CRC, size information and others). + +class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of the stage. + """ + + DEVICE_PREPARED = "DevicePrepared" #: Notification at device prepared stage. + DISPATCHED = "Dispatched" #: Notification at device dispatched stage. + DELIVERED = "Delivered" #: Notification at device delivered stage. + PICKED_UP = "PickedUp" #: Notification at device picked up from user stage. + AT_AZURE_DC = "AtAzureDC" #: Notification at device received at Azure datacenter stage. + DATA_COPY = "DataCopy" #: Notification at data copy started stage. + +class OverallValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Overall validation status. + """ + + ALL_VALID_TO_PROCEED = "AllValidToProceed" #: Every input request is valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" #: Some input requests are not valid. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" #: Certain input validations skipped. + +class ShareDestinationFormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the share. + """ + + UNKNOWN_TYPE = "UnknownType" #: Unknown format. + HCS = "HCS" #: Storsimple data format. + BLOCK_BLOB = "BlockBlob" #: Azure storage block blob format. + PAGE_BLOB = "PageBlob" #: Azure storage page blob format. + AZURE_FILE = "AzureFile" #: Azure storage file format. + MANAGED_DISK = "ManagedDisk" #: Azure Compute Disk. + AZURE_PREMIUM_FILES = "AzurePremiumFiles" #: Azure storage Premium Files format. + +class SkuDisabledReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Reason why the Sku is disabled. + """ + + NONE = "None" #: SKU is not disabled. + COUNTRY = "Country" #: SKU is not available in the requested country. + REGION = "Region" #: SKU is not available to push data to the requested Azure region. + FEATURE = "Feature" #: Required features are not enabled for the SKU. + OFFER_TYPE = "OfferType" #: Subscription does not have required offer types for the SKU. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DATA_BOX = "DataBox" #: Data Box. + DATA_BOX_DISK = "DataBoxDisk" #: Data Box Disk. + DATA_BOX_HEAVY = "DataBoxHeavy" #: Data Box Heavy. + +class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of the stage which is in progress. + """ + + DEVICE_ORDERED = "DeviceOrdered" #: An order has been created. + DEVICE_PREPARED = "DevicePrepared" #: A device has been prepared for the order. + DISPATCHED = "Dispatched" #: Device has been dispatched to the user of the order. + DELIVERED = "Delivered" #: Device has been delivered to the user of the order. + PICKED_UP = "PickedUp" #: Device has been picked up from user and in transit to Azure datacenter. + AT_AZURE_DC = "AtAzureDC" #: Device has been received at Azure datacenter from the user. + DATA_COPY = "DataCopy" #: Data copy from the device at Azure datacenter. + COMPLETED = "Completed" #: Order has completed. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Order has completed with errors. + CANCELLED = "Cancelled" #: Order has been cancelled. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" #: Order has failed due to issue reported by user. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" #: Order has failed due to issue detected at Azure datacenter. + ABORTED = "Aborted" #: Order has been aborted. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" #: Order has completed with warnings. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" #: Device is ready to be handed to customer from Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" #: Device can be dropped off at Azure DC. + +class StageStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the job stage. + """ + + NONE = "None" #: No status available yet. + IN_PROGRESS = "InProgress" #: Stage is in progress. + SUCCEEDED = "Succeeded" #: Stage has succeeded. + FAILED = "Failed" #: Stage has failed. + CANCELLED = "Cancelled" #: Stage has been cancelled. + CANCELLING = "Cancelling" #: Stage is cancelling. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" #: Stage has succeeded with errors. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" #: Stage is stuck until customer takes some action. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" #: Stage has succeeded with warnings. + +class TransferConfigurationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the configuration for transfer. + """ + + TRANSFER_ALL = "TransferAll" #: Transfer all the data. + TRANSFER_USING_FILTER = "TransferUsingFilter" #: Transfer using filter. + +class TransferType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the transfer. + """ + + IMPORT_TO_AZURE = "ImportToAzure" #: Import data to azure. + EXPORT_FROM_AZURE = "ExportFromAzure" #: Export data from azure. + +class TransportShipmentTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Transport Shipment Type supported for given region. + """ + + CUSTOMER_MANAGED = "CustomerManaged" #: Shipment Logistics is handled by the customer. + MICROSOFT_MANAGED = "MicrosoftManaged" #: Shipment Logistics is handled by Microsoft. + +class ValidationInputDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Identifies the type of validation request. + """ + + VALIDATE_ADDRESS = "ValidateAddress" #: Identify request and response of address validation. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" #: Identify request and response for validation of subscription permission to create job. + VALIDATE_PREFERENCES = "ValidatePreferences" #: Identify request and response of preference validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" #: Identify request and response of create order limit for subscription validation. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" #: Identify request and response of active job limit for sku availability. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" #: Identify request and response of data transfer details validation. + +class ValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Create order limit validation status. + """ + + VALID = "Valid" #: Validation is successful. + INVALID = "Invalid" #: Validation is not successful. + SKIPPED = "Skipped" #: Validation is skipped. diff --git a/src/databox/azext_databox/vendored_sdks/databox/models/_models.py b/src/databox/azext_databox/vendored_sdks/databox/models/_models.py index 34a4d7aa419..4890185c594 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/models/_models.py +++ b/src/databox/azext_databox/vendored_sdks/databox/models/_models.py @@ -1,76 +1,98 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from azure.core.exceptions import HttpResponseError +import msrest.serialization -class AccountCredentialDetails(Model): +class AccountCredentialDetails(msrest.serialization.Model): """Credential details of the account. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar account_name: Name of the account. :vartype account_name: str - :ivar data_destination_type: Data Destination Type. Possible values - include: 'StorageAccount', 'ManagedDisk' - :vartype data_destination_type: str or - ~azure.mgmt.databox.models.DataDestinationType - :ivar account_connection_string: Connection string of the account endpoint - to use the account as a storage endpoint on the device. + :ivar data_account_type: Type of the account. Possible values include: "StorageAccount", + "ManagedDisk". + :vartype data_account_type: str or ~data_box_management_client.models.DataAccountType + :ivar account_connection_string: Connection string of the account endpoint to use the account + as a storage endpoint on the device. :vartype account_connection_string: str - :ivar share_credential_details: Per share level unencrypted access - credentials. + :ivar share_credential_details: Per share level unencrypted access credentials. :vartype share_credential_details: - list[~azure.mgmt.databox.models.ShareCredentialDetails] + list[~data_box_management_client.models.ShareCredentialDetails] """ _validation = { 'account_name': {'readonly': True}, - 'data_destination_type': {'readonly': True}, + 'data_account_type': {'readonly': True}, 'account_connection_string': {'readonly': True}, 'share_credential_details': {'readonly': True}, } _attribute_map = { 'account_name': {'key': 'accountName', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'DataDestinationType'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, 'account_connection_string': {'key': 'accountConnectionString', 'type': 'str'}, 'share_credential_details': {'key': 'shareCredentialDetails', 'type': '[ShareCredentialDetails]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AccountCredentialDetails, self).__init__(**kwargs) self.account_name = None - self.data_destination_type = None + self.data_account_type = None self.account_connection_string = None self.share_credential_details = None -class AddressValidationOutput(Model): +class AdditionalErrorInfo(msrest.serialization.Model): + """Additional error info. + + :param type: Additional error type. + :type type: str + :param info: Additional error info. + :type info: object + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(AdditionalErrorInfo, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.info = kwargs.get('info', None) + + +class AddressValidationOutput(msrest.serialization.Model): """Output of the address validation api. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. + :param validation_type: Identifies the type of validation response.Constant filled by server. + Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar validation_status: The address validation status. Possible values - include: 'Valid', 'Invalid', 'Ambiguous' - :vartype validation_status: str or - ~azure.mgmt.databox.models.AddressValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar validation_status: The address validation status. Possible values include: "Valid", + "Invalid", "Ambiguous". + :vartype validation_status: str or ~data_box_management_client.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: - list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~data_box_management_client.models.ShippingAddress] """ _validation = { @@ -80,23 +102,139 @@ class AddressValidationOutput(Model): } _attribute_map = { - 'error': {'key': 'properties.error', 'type': 'Error'}, - 'validation_status': {'key': 'properties.validationStatus', 'type': 'AddressValidationStatus'}, + 'validation_type': {'key': 'properties.validationType', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'CloudError'}, + 'validation_status': {'key': 'properties.validationStatus', 'type': 'str'}, 'alternate_addresses': {'key': 'properties.alternateAddresses', 'type': '[ShippingAddress]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AddressValidationOutput, self).__init__(**kwargs) + self.validation_type = None # type: Optional[str] + self.error = None + self.validation_status = None + self.alternate_addresses = None + + +class ValidationInputResponse(msrest.serialization.Model): + """Minimum properties that should be present in each individual validation response. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, DataTransferDetailsValidationResponseProperties, PreferencesValidationResponseProperties, SkuAvailabilityValidationResponseProperties, SubscriptionIsAllowedToCreateJobValidationResponseProperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + } + + _subtype_map = { + 'validation_type': {'ValidateAddress': 'AddressValidationProperties', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} + } + + def __init__( + self, + **kwargs + ): + super(ValidationInputResponse, self).__init__(**kwargs) + self.validation_type = None # type: Optional[str] self.error = None + + +class AddressValidationProperties(ValidationInputResponse): + """The address validation output. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + :ivar validation_status: The address validation status. Possible values include: "Valid", + "Invalid", "Ambiguous". + :vartype validation_status: str or ~data_box_management_client.models.AddressValidationStatus + :ivar alternate_addresses: List of alternate addresses. + :vartype alternate_addresses: list[~data_box_management_client.models.ShippingAddress] + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'validation_status': {'readonly': True}, + 'alternate_addresses': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'validation_status': {'key': 'validationStatus', 'type': 'str'}, + 'alternate_addresses': {'key': 'alternateAddresses', 'type': '[ShippingAddress]'}, + } + + def __init__( + self, + **kwargs + ): + super(AddressValidationProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateAddress' # type: str self.validation_status = None self.alternate_addresses = None -class ApplianceNetworkConfiguration(Model): +class ApiError(msrest.serialization.Model): + """ApiError. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. + :type error: ~data_box_management_client.models.ErrorDetail + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.error = kwargs['error'] + + +class ApplianceNetworkConfiguration(msrest.serialization.Model): """The Network Adapter configuration of a DataBox. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the network. :vartype name: str @@ -114,17 +252,19 @@ class ApplianceNetworkConfiguration(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ApplianceNetworkConfiguration, self).__init__(**kwargs) self.name = None self.mac_address = None -class ArmBaseObject(Model): +class ArmBaseObject(msrest.serialization.Model): """Base class for all objects under resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the object. :vartype name: str @@ -146,38 +286,36 @@ class ArmBaseObject(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ArmBaseObject, self).__init__(**kwargs) self.name = None self.id = None self.type = None -class AvailableSkuRequest(Model): +class AvailableSkuRequest(msrest.serialization.Model): """The filters for showing the available skus. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. - :ivar transfer_type: Required. Type of the transfer. Default value: - "ImportToAzure" . - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. - For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType + :param country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. :type country: str - :param location: Required. Location for data transfer. For locations - check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type location: str - :param sku_names: Sku Names to filter for available skus - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + :param sku_names: Sku Names to filter for available skus. + :type sku_names: list[str or ~data_box_management_client.models.SkuName] """ _validation = { - 'transfer_type': {'required': True, 'constant': True}, + 'transfer_type': {'required': True}, 'country': {'required': True}, 'location': {'required': True}, } @@ -186,19 +324,104 @@ class AvailableSkuRequest(Model): 'transfer_type': {'key': 'transferType', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, - 'sku_names': {'key': 'skuNames', 'type': '[SkuName]'}, + 'sku_names': {'key': 'skuNames', 'type': '[str]'}, } - transfer_type = "ImportToAzure" - - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AvailableSkuRequest, self).__init__(**kwargs) - self.country = kwargs.get('country', None) - self.location = kwargs.get('location', None) + self.transfer_type = kwargs['transfer_type'] + self.country = kwargs['country'] + self.location = kwargs['location'] self.sku_names = kwargs.get('sku_names', None) -class CancellationReason(Model): +class AvailableSkusResult(msrest.serialization.Model): + """The available skus operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of available skus. + :vartype value: list[~data_box_management_client.models.SkuInformation] + :param next_link: Link for the next set of skus. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInformation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableSkusResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class AzureFileFilterDetails(msrest.serialization.Model): + """Filter details to transfer Azure files. + + :param file_prefix_list: Prefix list of the Azure files to be transferred. + :type file_prefix_list: list[str] + :param file_path_list: List of full path of the files to be transferred. + :type file_path_list: list[str] + :param file_share_list: List of file shares to be transferred. + :type file_share_list: list[str] + """ + + _attribute_map = { + 'file_prefix_list': {'key': 'filePrefixList', 'type': '[str]'}, + 'file_path_list': {'key': 'filePathList', 'type': '[str]'}, + 'file_share_list': {'key': 'fileShareList', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileFilterDetails, self).__init__(**kwargs) + self.file_prefix_list = kwargs.get('file_prefix_list', None) + self.file_path_list = kwargs.get('file_path_list', None) + self.file_share_list = kwargs.get('file_share_list', None) + + +class BlobFilterDetails(msrest.serialization.Model): + """Filter details to transfer Azure Blobs. + + :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :type blob_prefix_list: list[str] + :param blob_path_list: List of full path of the blobs to be transferred. + :type blob_path_list: list[str] + :param container_list: List of blob containers to be transferred. + :type container_list: list[str] + """ + + _attribute_map = { + 'blob_prefix_list': {'key': 'blobPrefixList', 'type': '[str]'}, + 'blob_path_list': {'key': 'blobPathList', 'type': '[str]'}, + 'container_list': {'key': 'containerList', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobFilterDetails, self).__init__(**kwargs) + self.blob_prefix_list = kwargs.get('blob_prefix_list', None) + self.blob_path_list = kwargs.get('blob_path_list', None) + self.container_list = kwargs.get('container_list', None) + + +class CancellationReason(msrest.serialization.Model): """Reason for cancellation. All required parameters must be populated in order to send to Azure. @@ -215,30 +438,34 @@ class CancellationReason(Model): 'reason': {'key': 'reason', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CancellationReason, self).__init__(**kwargs) - self.reason = kwargs.get('reason', None) + self.reason = kwargs['reason'] -class CloudError(Model): - """The error information object. +class CloudError(msrest.serialization.Model): + """Cloud error. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: Error code string. - :vartype code: str - :ivar message: Descriptive error information. - :vartype message: str - :param target: Error target + :param code: Cloud error code. + :type code: str + :param message: Cloud error message. + :type message: str + :param target: Cloud error target. :type target: str - :param details: More detailed error information. - :type details: list[~azure.mgmt.databox.models.CloudError] + :ivar details: Cloud error details. + :vartype details: list[~data_box_management_client.models.CloudError] + :ivar additional_info: Cloud error additional info. + :vartype additional_info: list[~data_box_management_client.models.AdditionalErrorInfo] """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { @@ -246,29 +473,22 @@ class CloudError(Model): 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'details': {'key': 'details', 'type': '[CloudError]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[AdditionalErrorInfo]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudError, self).__init__(**kwargs) - self.code = None - self.message = None + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + self.details = None + self.additional_info = None -class ContactDetails(Model): +class ContactDetails(msrest.serialization.Model): """Contact Details. All required parameters must be populated in order to send to Azure. @@ -281,12 +501,10 @@ class ContactDetails(Model): :type phone_extension: str :param mobile: Mobile number of the contact person. :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job - progress. + :param email_list: Required. List of Email-ids to be notified about job progress. :type email_list: list[str] :param notification_preference: Notification preference for a job stage. - :type notification_preference: - list[~azure.mgmt.databox.models.NotificationPreference] + :type notification_preference: list[~data_box_management_client.models.NotificationPreference] """ _validation = { @@ -304,27 +522,30 @@ class ContactDetails(Model): 'notification_preference': {'key': 'notificationPreference', 'type': '[NotificationPreference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContactDetails, self).__init__(**kwargs) - self.contact_name = kwargs.get('contact_name', None) - self.phone = kwargs.get('phone', None) + self.contact_name = kwargs['contact_name'] + self.phone = kwargs['phone'] self.phone_extension = kwargs.get('phone_extension', None) self.mobile = kwargs.get('mobile', None) - self.email_list = kwargs.get('email_list', None) + self.email_list = kwargs['email_list'] self.notification_preference = kwargs.get('notification_preference', None) -class CopyLogDetails(Model): +class CopyLogDetails(msrest.serialization.Model): """Details for log generated during copy. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, - DataBoxHeavyAccountCopyLogDetails + sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator """ _validation = { @@ -339,54 +560,64 @@ class CopyLogDetails(Model): 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = None + self.copy_log_details_type = None # type: Optional[str] -class CopyProgress(Model): +class CopyProgress(msrest.serialization.Model): """Copy progress. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar storage_account_name: Name of the storage account where the data - needs to be uploaded. + :ivar storage_account_name: Name of the storage account. This will be empty for data account + types other than storage account. :vartype storage_account_name: str - :ivar data_destination_type: Data Destination Type. Possible values - include: 'StorageAccount', 'ManagedDisk' - :vartype data_destination_type: str or - ~azure.mgmt.databox.models.DataDestinationType + :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", + "ExportFromAzure". + :vartype transfer_type: str or ~data_box_management_client.models.TransferType + :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", + "ManagedDisk". + :vartype data_account_type: str or ~data_box_management_client.models.DataAccountType :ivar account_id: Id of the account where the data needs to be uploaded. :vartype account_id: str - :ivar bytes_sent_to_cloud: Amount of data uploaded by the job as of now. - :vartype bytes_sent_to_cloud: long - :ivar total_bytes_to_process: Total amount of data to be processed by the - job. + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: long + :ivar total_bytes_to_process: Total amount of data to be processed by the job. :vartype total_bytes_to_process: long - :ivar files_processed: Number of files processed by the job as of now. + :ivar files_processed: Number of files processed. :vartype files_processed: long - :ivar total_files_to_process: Total number of files to be processed by the - job. + :ivar total_files_to_process: Total files to process. :vartype total_files_to_process: long - :ivar invalid_files_processed: Number of files not adhering to azure - naming conventions which were processed by automatic renaming + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. :vartype invalid_files_processed: long - :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to - azure naming conventions which were processed by automatic renaming + :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to azure naming + conventions which were processed by automatic renaming. :vartype invalid_file_bytes_uploaded: long - :ivar renamed_container_count: Number of folders not adhering to azure - naming conventions which were processed by automatic renaming + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. :vartype renamed_container_count: long - :ivar files_errored_out: Number of files which could not be copied + :ivar files_errored_out: Number of files which could not be copied. :vartype files_errored_out: long + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: long + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: long + :ivar is_enumeration_in_progress: To indicate if enumeration of data is in progress. + Until this is true, the TotalBytesToProcess may not be valid. + :vartype is_enumeration_in_progress: bool """ _validation = { 'storage_account_name': {'readonly': True}, - 'data_destination_type': {'readonly': True}, + 'transfer_type': {'readonly': True}, + 'data_account_type': {'readonly': True}, 'account_id': {'readonly': True}, - 'bytes_sent_to_cloud': {'readonly': True}, + 'bytes_processed': {'readonly': True}, 'total_bytes_to_process': {'readonly': True}, 'files_processed': {'readonly': True}, 'total_files_to_process': {'readonly': True}, @@ -394,13 +625,17 @@ class CopyProgress(Model): 'invalid_file_bytes_uploaded': {'readonly': True}, 'renamed_container_count': {'readonly': True}, 'files_errored_out': {'readonly': True}, + 'directories_errored_out': {'readonly': True}, + 'invalid_directories_processed': {'readonly': True}, + 'is_enumeration_in_progress': {'readonly': True}, } _attribute_map = { 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'DataDestinationType'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, 'account_id': {'key': 'accountId', 'type': 'str'}, - 'bytes_sent_to_cloud': {'key': 'bytesSentToCloud', 'type': 'long'}, + 'bytes_processed': {'key': 'bytesProcessed', 'type': 'long'}, 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, @@ -408,14 +643,21 @@ class CopyProgress(Model): 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, + 'directories_errored_out': {'key': 'directoriesErroredOut', 'type': 'long'}, + 'invalid_directories_processed': {'key': 'invalidDirectoriesProcessed', 'type': 'long'}, + 'is_enumeration_in_progress': {'key': 'isEnumerationInProgress', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CopyProgress, self).__init__(**kwargs) self.storage_account_name = None - self.data_destination_type = None + self.transfer_type = None + self.data_account_type = None self.account_id = None - self.bytes_sent_to_cloud = None + self.bytes_processed = None self.total_bytes_to_process = None self.files_processed = None self.total_files_to_process = None @@ -423,42 +665,49 @@ def __init__(self, **kwargs): self.invalid_file_bytes_uploaded = None self.renamed_container_count = None self.files_errored_out = None + self.directories_errored_out = None + self.invalid_directories_processed = None + self.is_enumeration_in_progress = None -class ValidationRequest(Model): - """Input request for all pre job creation validation. +class ValidationRequest(msrest.serialization.Model): + """Minimum request requirement of any validation category. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CreateJobValidations + sub-classes are: CreateJobValidations. All required parameters must be populated in order to send to Azure. - :param individual_request_details: Required. List of request details - contain validationType and its request as key and value respectively. - :type individual_request_details: - list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Constant filled by server. + :param validation_category: Required. Identify the nature of validation.Constant filled by + server. :type validation_category: str + :param individual_request_details: Required. List of request details contain validationType and + its request as key and value respectively. + :type individual_request_details: + list[~data_box_management_client.models.ValidationInputRequest] """ _validation = { - 'individual_request_details': {'required': True}, 'validation_category': {'required': True}, + 'individual_request_details': {'required': True}, } _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, } _subtype_map = { 'validation_category': {'JobCreationValidation': 'CreateJobValidations'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ValidationRequest, self).__init__(**kwargs) - self.individual_request_details = kwargs.get('individual_request_details', None) - self.validation_category = None + self.validation_category = None # type: Optional[str] + self.individual_request_details = kwargs['individual_request_details'] class CreateJobValidations(ValidationRequest): @@ -466,42 +715,46 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param individual_request_details: Required. List of request details - contain validationType and its request as key and value respectively. - :type individual_request_details: - list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Constant filled by server. + :param validation_category: Required. Identify the nature of validation.Constant filled by + server. :type validation_category: str + :param individual_request_details: Required. List of request details contain validationType and + its request as key and value respectively. + :type individual_request_details: + list[~data_box_management_client.models.ValidationInputRequest] """ _validation = { - 'individual_request_details': {'required': True}, 'validation_category': {'required': True}, + 'individual_request_details': {'required': True}, } _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CreateJobValidations, self).__init__(**kwargs) - self.validation_category = 'JobCreationValidation' + self.validation_category = 'JobCreationValidation' # type: str -class ValidationInputRequest(Model): +class ValidationInputRequest(msrest.serialization.Model): """Minimum fields that must be present in any type of validation request. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CreateOrderLimitForSubscriptionValidationRequest, - DataDestinationDetailsValidationRequest, PreferencesValidationRequest, - SkuAvailabilityValidationRequest, - SubscriptionIsAllowedToCreateJobValidationRequest, ValidateAddress + sub-classes are: ValidateAddress, CreateOrderLimitForSubscriptionValidationRequest, DataTransferDetailsValidationRequest, PreferencesValidationRequest, SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator """ _validation = { @@ -513,12 +766,15 @@ class ValidationInputRequest(Model): } _subtype_map = { - 'validation_type': {'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataDestinationDetails': 'DataDestinationDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest', 'ValidateAddress': 'ValidateAddress'} + 'validation_type': {'ValidateAddress': 'ValidateAddress', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ValidationInputRequest, self).__init__(**kwargs) - self.validation_type = None + self.validation_type = None # type: Optional[str] class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): @@ -526,11 +782,14 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName """ _validation = { @@ -540,138 +799,154 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) - self.device_type = kwargs.get('device_type', None) - self.validation_type = 'ValidateCreateOrderLimit' + self.validation_type = 'ValidateCreateOrderLimit' # type: str + self.device_type = kwargs['device_type'] -class ValidationInputResponse(Model): - """Minimum properties that should be present in each individual validation - response. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: - CreateOrderLimitForSubscriptionValidationResponseProperties, - DataDestinationDetailsValidationResponseProperties, - PreferencesValidationResponseProperties, - SkuAvailabilityValidationResponseProperties, - SubscriptionIsAllowedToCreateJobValidationResponseProperties +class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): + """Properties of create order limit for subscription validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Create order limit validation status. Possible values include: "Valid", + "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - _subtype_map = { - 'validation_type': {'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataDestinationDetails': 'DataDestinationDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} - } - - def __init__(self, **kwargs): - super(ValidationInputResponse, self).__init__(**kwargs) - self.error = None - self.validation_type = None + def __init__( + self, + **kwargs + ): + super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateCreateOrderLimit' # type: str + self.status = None -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. +class DataAccountDetails(msrest.serialization.Model): + """Account details of the data to be transferred. - Variables are only populated by the server, and will be ignored when - sending a request. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ManagedDiskDetails, StorageAccountDetails. All required parameters must be populated in order to send to Azure. - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Create order limit validation status. Possible values - include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str """ _validation = { - 'error': {'readonly': True}, - 'validation_type': {'required': True}, - 'status': {'readonly': True}, + 'data_account_type': {'required': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, } - def __init__(self, **kwargs): - super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) - self.status = None - self.validation_type = 'ValidateCreateOrderLimit' + _subtype_map = { + 'data_account_type': {'ManagedDisk': 'ManagedDiskDetails', 'StorageAccount': 'StorageAccountDetails'} + } + + def __init__( + self, + **kwargs + ): + super(DataAccountDetails, self).__init__(**kwargs) + self.data_account_type = None # type: Optional[str] + self.share_password = kwargs.get('share_password', None) class DataBoxAccountCopyLogDetails(CopyLogDetails): """Copy log details for a storage account of a DataBox job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str - :ivar account_name: Destination account name. + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. :vartype copy_log_link: str + :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when + LogCollectionLevel is set to Verbose. + :vartype copy_verbose_log_link: str """ _validation = { 'copy_log_details_type': {'required': True}, 'account_name': {'readonly': True}, 'copy_log_link': {'readonly': True}, + 'copy_verbose_log_link': {'readonly': True}, } _attribute_map = { 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, 'account_name': {'key': 'accountName', 'type': 'str'}, 'copy_log_link': {'key': 'copyLogLink', 'type': 'str'}, + 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBox' # type: str self.account_name = None self.copy_log_link = None - self.copy_log_details_type = 'DataBox' + self.copy_verbose_log_link = None class DataBoxDiskCopyLogDetails(CopyLogDetails): """Copy Log Details for a disk. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator :ivar disk_serial_number: Disk Serial Number. :vartype disk_serial_number: str :ivar error_log_link: Link for copy error logs. @@ -694,32 +969,32 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): 'verbose_log_link': {'key': 'verboseLogLink', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBoxDisk' # type: str self.disk_serial_number = None self.error_log_link = None self.verbose_log_link = None - self.copy_log_details_type = 'DataBoxDisk' -class DataBoxDiskCopyProgress(Model): +class DataBoxDiskCopyProgress(msrest.serialization.Model): """DataBox Disk Copy Progress. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar serial_number: The serial number of the disk + :ivar serial_number: The serial number of the disk. :vartype serial_number: str :ivar bytes_copied: Bytes copied during the copy of disk. :vartype bytes_copied: long - :ivar percent_complete: Indicates the percentage completed for the copy of - the disk. + :ivar percent_complete: Indicates the percentage completed for the copy of the disk. :vartype percent_complete: int - :ivar status: The Status of the copy. Possible values include: - 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', - 'NotReturned', 'HardwareError', 'DeviceFormatted', - 'DeviceMetadataModified', 'StorageAccountNotAccessible', 'UnsupportedData' - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". + :vartype status: str or ~data_box_management_client.models.CopyStatus """ _validation = { @@ -733,10 +1008,13 @@ class DataBoxDiskCopyProgress(Model): 'serial_number': {'key': 'serialNumber', 'type': 'str'}, 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'CopyStatus'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxDiskCopyProgress, self).__init__(**kwargs) self.serial_number = None self.bytes_copied = None @@ -744,153 +1022,147 @@ def __init__(self, **kwargs): self.status = None -class JobDetails(Model): +class JobDetails(msrest.serialization.Model): """Job details. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxDiskJobDetails, DataBoxHeavyJobDetails, - DataBoxJobDetails + sub-classes are: DataBoxJobDetails, DataBoxDiskJobDetails, DataBoxHeavyJobDetails. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, + 'key_encryption_key': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, } _subtype_map = { - 'job_details_type': {'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails', 'DataBox': 'DataBoxJobDetails'} + 'job_details_type': {'DataBox': 'DataBoxJobDetails', 'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(JobDetails, self).__init__(**kwargs) - self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) self.job_stages = None - self.contact_details = kwargs.get('contact_details', None) + self.contact_details = kwargs['contact_details'] self.shipping_address = kwargs.get('shipping_address', None) self.delivery_package = None self.return_package = None - self.destination_account_details = kwargs.get('destination_account_details', None) - self.error_details = None + self.data_import_details = kwargs.get('data_import_details', None) + self.data_export_details = kwargs.get('data_export_details', None) + self.job_details_type = None # type: Optional[str] self.preferences = kwargs.get('preferences', None) self.copy_log_details = None self.reverse_shipment_label_sas_key = None self.chain_of_custody_sas_key = None - self.job_details_type = None + self.key_encryption_key = None + self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) class DataBoxDiskJobDetails(JobDetails): """DataBox Disk Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str - :param preferred_disks: User preference on what size disks are needed for - the job. The map is from the disk size in TB to the count. Eg. {2,5} means - 5 disks of 2 TB size. Key is string but will be checked against an int. + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int + :param preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. :type preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: - list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to - the disk size being used for the job. Is returned only after the disks are - shipped to the customer. + :vartype copy_progress: list[~data_box_management_client.models.DataBoxDiskCopyProgress] + :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being + used for the job. Is returned only after the disks are shipped to the customer. :vartype disks_and_size_details: dict[str, int] :param passkey: User entered passkey for DataBox Disk job. :type passkey: str @@ -899,100 +1171,111 @@ class DataBoxDiskJobDetails(JobDetails): _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, + 'key_encryption_key': {'readonly': True}, 'copy_progress': {'readonly': True}, 'disks_and_size_details': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, 'passkey': {'key': 'passkey', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxDiskJobDetails, self).__init__(**kwargs) + self.job_details_type = 'DataBoxDisk' # type: str self.preferred_disks = kwargs.get('preferred_disks', None) self.copy_progress = None self.disks_and_size_details = None self.passkey = kwargs.get('passkey', None) - self.job_details_type = 'DataBoxDisk' -class JobSecrets(Model): +class JobSecrets(msrest.serialization.Model): """The base class for the secrets. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets, - DataboxJobSecrets + sub-classes are: DataboxJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, } _subtype_map = { - 'job_secrets_type': {'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets', 'DataBox': 'DataboxJobSecrets'} + 'job_secrets_type': {'DataBox': 'DataboxJobSecrets', 'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(JobSecrets, self).__init__(**kwargs) - self.dc_access_security_code = kwargs.get('dc_access_security_code', None) - self.job_secrets_type = None + self.job_secrets_type = None # type: Optional[str] + self.dc_access_security_code = None + self.error = None class DataBoxDiskJobSecrets(JobSecrets): """The secrets related to disk job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] + :vartype disk_secrets: list[~data_box_management_client.models.DiskSecret] :ivar pass_key: PassKey for the disk Job. :vartype pass_key: str :ivar is_passkey_user_defined: Whether passkey was provided by user. @@ -1001,190 +1284,212 @@ class DataBoxDiskJobSecrets(JobSecrets): _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, 'disk_secrets': {'readonly': True}, 'pass_key': {'readonly': True}, 'is_passkey_user_defined': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'disk_secrets': {'key': 'diskSecrets', 'type': '[DiskSecret]'}, 'pass_key': {'key': 'passKey', 'type': 'str'}, 'is_passkey_user_defined': {'key': 'isPasskeyUserDefined', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxDiskJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBoxDisk' # type: str self.disk_secrets = None self.pass_key = None self.is_passkey_user_defined = None - self.job_secrets_type = 'DataBoxDisk' class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): """Copy log details for a storage account for Databox heavy. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str - :ivar account_name: Destination account name. + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. :vartype copy_log_link: list[str] + :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when the + LogCollectionLevel is set to verbose. + :vartype copy_verbose_log_link: list[str] """ _validation = { 'copy_log_details_type': {'required': True}, 'account_name': {'readonly': True}, 'copy_log_link': {'readonly': True}, + 'copy_verbose_log_link': {'readonly': True}, } _attribute_map = { 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, 'account_name': {'key': 'accountName', 'type': 'str'}, 'copy_log_link': {'key': 'copyLogLink', 'type': '[str]'}, + 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBoxHeavy' # type: str self.account_name = None self.copy_log_link = None - self.copy_log_details_type = 'DataBoxHeavy' + self.copy_verbose_log_link = None class DataBoxHeavyJobDetails(JobDetails): """Databox Heavy Device Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy + :vartype copy_progress: list[~data_box_management_client.models.CopyProgress] + :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed + for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. :type device_password: str """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, + 'key_encryption_key': {'readonly': True}, 'copy_progress': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxHeavyJobDetails, self).__init__(**kwargs) + self.job_details_type = 'DataBoxHeavy' # type: str self.copy_progress = None self.device_password = kwargs.get('device_password', None) - self.job_details_type = 'DataBoxHeavy' class DataBoxHeavyJobSecrets(JobSecrets): """The secrets related to a databox heavy job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str - :ivar cabinet_pod_secrets: Contains the list of secret objects for a - databox heavy job. - :vartype cabinet_pod_secrets: - list[~azure.mgmt.databox.models.DataBoxHeavySecret] + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError + :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. + :vartype cabinet_pod_secrets: list[~data_box_management_client.models.DataBoxHeavySecret] """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, 'cabinet_pod_secrets': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'cabinet_pod_secrets': {'key': 'cabinetPodSecrets', 'type': '[DataBoxHeavySecret]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBoxHeavy' # type: str self.cabinet_pod_secrets = None - self.job_secrets_type = 'DataBoxHeavy' -class DataBoxHeavySecret(Model): +class DataBoxHeavySecret(msrest.serialization.Model): """The secrets related to a databox heavy. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar device_serial_number: Serial number of the assigned device. :vartype device_serial_number: str @@ -1192,13 +1497,13 @@ class DataBoxHeavySecret(Model): :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. :vartype network_configurations: - list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to - authenticate with the device + list[~data_box_management_client.models.ApplianceNetworkConfiguration] + :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the + device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. :vartype account_credential_details: - list[~azure.mgmt.databox.models.AccountCredentialDetails] + list[~data_box_management_client.models.AccountCredentialDetails] """ _validation = { @@ -1217,7 +1522,10 @@ class DataBoxHeavySecret(Model): 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxHeavySecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1229,135 +1537,149 @@ def __init__(self, **kwargs): class DataBoxJobDetails(JobDetails): """Databox Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox + :vartype copy_progress: list[~data_box_management_client.models.CopyProgress] + :param device_password: Set Device password for unlocking Databox. Should not be passed for + TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password + itself. This will not be returned in Get Call. Password Requirements : Password must be + minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, + one number and one special character. Password cannot have the following characters : IilLoO0 + Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. :type device_password: str """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, + 'key_encryption_key': {'readonly': True}, 'copy_progress': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxJobDetails, self).__init__(**kwargs) + self.job_details_type = 'DataBox' # type: str self.copy_progress = None self.device_password = kwargs.get('device_password', None) - self.job_details_type = 'DataBox' class DataboxJobSecrets(JobSecrets): """The secrets related to a databox job. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :type pod_secrets: list[~data_box_management_client.models.DataBoxSecret] """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataboxJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBox' # type: str self.pod_secrets = kwargs.get('pod_secrets', None) - self.job_secrets_type = 'DataBox' -class ScheduleAvailabilityRequest(Model): +class ScheduleAvailabilityRequest(msrest.serialization.Model): """Request body to get the availability for scheduling orders. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxScheduleAvailabilityRequest, - DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest + sub-classes are: DataBoxScheduleAvailabilityRequest, DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest. All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { @@ -1368,16 +1690,21 @@ class ScheduleAvailabilityRequest(Model): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } _subtype_map = { 'sku_name': {'DataBox': 'DataBoxScheduleAvailabilityRequest', 'DataBoxDisk': 'DiskScheduleAvailabilityRequest', 'DataBoxHeavy': 'HeavyScheduleAvailabilityRequest'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ScheduleAvailabilityRequest, self).__init__(**kwargs) - self.storage_location = kwargs.get('storage_location', None) - self.sku_name = None + self.storage_location = kwargs['storage_location'] + self.sku_name = None # type: Optional[str] + self.country = kwargs.get('country', None) class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1385,12 +1712,14 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { @@ -1401,18 +1730,21 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBox' + self.sku_name = 'DataBox' # type: str -class DataBoxSecret(Model): +class DataBoxSecret(msrest.serialization.Model): """The secrets related to a DataBox. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar device_serial_number: Serial number of the assigned device. :vartype device_serial_number: str @@ -1420,13 +1752,13 @@ class DataBoxSecret(Model): :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. :vartype network_configurations: - list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to - authenticate with the device + list[~data_box_management_client.models.ApplianceNetworkConfiguration] + :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the + device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. :vartype account_credential_details: - list[~azure.mgmt.databox.models.AccountCredentialDetails] + list[~data_box_management_client.models.AccountCredentialDetails] """ _validation = { @@ -1445,7 +1777,10 @@ class DataBoxSecret(Model): 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataBoxSecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1454,235 +1789,235 @@ def __init__(self, **kwargs): self.account_credential_details = None -class DataDestinationDetailsValidationRequest(ValidationInputRequest): - """Request to validate data destination details. +class DataExportDetails(msrest.serialization.Model): + """Details of the data to be used for exporting data from azure. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param destination_account_details: Required. Destination account details - list. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param location: Required. Location of stamp or geo. - :type location: str + :param transfer_configuration: Required. Configuration for the data transfer. + :type transfer_configuration: ~data_box_management_client.models.TransferConfiguration + :param log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". + :type log_collection_level: str or ~data_box_management_client.models.LogCollectionLevel + :param account_details: Required. Account details of the data to be transferred. + :type account_details: ~data_box_management_client.models.DataAccountDetails """ _validation = { - 'validation_type': {'required': True}, - 'destination_account_details': {'required': True}, - 'location': {'required': True}, + 'transfer_configuration': {'required': True}, + 'account_details': {'required': True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, + 'transfer_configuration': {'key': 'transferConfiguration', 'type': 'TransferConfiguration'}, + 'log_collection_level': {'key': 'logCollectionLevel', 'type': 'str'}, + 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, } - def __init__(self, **kwargs): - super(DataDestinationDetailsValidationRequest, self).__init__(**kwargs) - self.destination_account_details = kwargs.get('destination_account_details', None) - self.location = kwargs.get('location', None) - self.validation_type = 'ValidateDataDestinationDetails' - + def __init__( + self, + **kwargs + ): + super(DataExportDetails, self).__init__(**kwargs) + self.transfer_configuration = kwargs['transfer_configuration'] + self.log_collection_level = kwargs.get('log_collection_level', None) + self.account_details = kwargs['account_details'] -class DataDestinationDetailsValidationResponseProperties(ValidationInputResponse): - """Properties of data destination details validation response. - Variables are only populated by the server, and will be ignored when - sending a request. +class DataImportDetails(msrest.serialization.Model): + """Details of the data to be used for importing data to azure. All required parameters must be populated in order to send to Azure. - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Data destination details validation status. Possible values - include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :param account_details: Required. Account details of the data to be transferred. + :type account_details: ~data_box_management_client.models.DataAccountDetails """ _validation = { - 'error': {'readonly': True}, - 'validation_type': {'required': True}, - 'status': {'readonly': True}, + 'account_details': {'required': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, } - def __init__(self, **kwargs): - super(DataDestinationDetailsValidationResponseProperties, self).__init__(**kwargs) - self.status = None - self.validation_type = 'ValidateDataDestinationDetails' + def __init__( + self, + **kwargs + ): + super(DataImportDetails, self).__init__(**kwargs) + self.account_details = kwargs['account_details'] -class DcAccessSecurityCode(Model): - """Dc Access Security code for device. +class DataLocationToServiceLocationMap(msrest.serialization.Model): + """Map of data location to service location. - :param forward_dc_access_code: Dc Access Code for dispatching from DC. - :type forward_dc_access_code: str - :param reverse_dc_access_code: Dc Access code for dropping off at DC. - :type reverse_dc_access_code: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar data_location: Location of the data. + :vartype data_location: str + :ivar service_location: Location of the service. + :vartype service_location: str """ - _attribute_map = { - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, + _validation = { + 'data_location': {'readonly': True}, + 'service_location': {'readonly': True}, } - def __init__(self, **kwargs): - super(DcAccessSecurityCode, self).__init__(**kwargs) - self.forward_dc_access_code = kwargs.get('forward_dc_access_code', None) - self.reverse_dc_access_code = kwargs.get('reverse_dc_access_code', None) + _attribute_map = { + 'data_location': {'key': 'dataLocation', 'type': 'str'}, + 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + } + def __init__( + self, + **kwargs + ): + super(DataLocationToServiceLocationMap, self).__init__(**kwargs) + self.data_location = None + self.service_location = None -class DestinationAccountDetails(Model): - """Details of the destination storage accounts. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DestinationManagedDiskDetails, - DestinationStorageAccountDetails +class DataTransferDetailsValidationRequest(ValidationInputRequest): + """Request to validate export and import data details. All required parameters must be populated in order to send to Azure. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param data_export_details: List of DataTransfer details to be used to export data from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param data_import_details: List of DataTransfer details to be used to import data to azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType """ _validation = { - 'data_destination_type': {'required': True}, + 'validation_type': {'required': True}, + 'device_type': {'required': True}, + 'transfer_type': {'required': True}, } _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, } - _subtype_map = { - 'data_destination_type': {'ManagedDisk': 'DestinationManagedDiskDetails', 'StorageAccount': 'DestinationStorageAccountDetails'} - } + def __init__( + self, + **kwargs + ): + super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateDataTransferDetails' # type: str + self.data_export_details = kwargs.get('data_export_details', None) + self.data_import_details = kwargs.get('data_import_details', None) + self.device_type = kwargs['device_type'] + self.transfer_type = kwargs['transfer_type'] - def __init__(self, **kwargs): - super(DestinationAccountDetails, self).__init__(**kwargs) - self.account_id = kwargs.get('account_id', None) - self.share_password = kwargs.get('share_password', None) - self.data_destination_type = None +class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): + """Properties of data transfer details validation response. -class DestinationManagedDiskDetails(DestinationAccountDetails): - """Details for the destination compute disks. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str - :param resource_group_id: Required. Destination Resource Group Id where - the Compute disks should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account - that can be used to copy the vhd for staging. - :type staging_storage_account_id: str + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Data transfer details validation status. Possible values include: "Valid", + "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'data_destination_type': {'required': True}, - 'resource_group_id': {'required': True}, - 'staging_storage_account_id': {'required': True}, + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, - 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs): - super(DestinationManagedDiskDetails, self).__init__(**kwargs) - self.resource_group_id = kwargs.get('resource_group_id', None) - self.staging_storage_account_id = kwargs.get('staging_storage_account_id', None) - self.data_destination_type = 'ManagedDisk' - + def __init__( + self, + **kwargs + ): + super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateDataTransferDetails' # type: str + self.status = None -class DestinationStorageAccountDetails(DestinationAccountDetails): - """Details for the destination storage account. - All required parameters must be populated in order to send to Azure. +class DcAccessSecurityCode(msrest.serialization.Model): + """Dc access security code. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type storage_account_id: str + :param reverse_dc_access_code: Reverse Dc access security code. + :type reverse_dc_access_code: str + :param forward_dc_access_code: Forward Dc access security code. + :type forward_dc_access_code: str """ - _validation = { - 'data_destination_type': {'required': True}, - 'storage_account_id': {'required': True}, - } - _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, + 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, } - def __init__(self, **kwargs): - super(DestinationStorageAccountDetails, self).__init__(**kwargs) - self.storage_account_id = kwargs.get('storage_account_id', None) - self.data_destination_type = 'StorageAccount' + def __init__( + self, + **kwargs + ): + super(DcAccessSecurityCode, self).__init__(**kwargs) + self.reverse_dc_access_code = kwargs.get('reverse_dc_access_code', None) + self.forward_dc_access_code = kwargs.get('forward_dc_access_code', None) -class DestinationToServiceLocationMap(Model): - """Map of destination location to service location. +class Details(msrest.serialization.Model): + """Details. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar destination_location: Location of the destination. - :vartype destination_location: str - :ivar service_location: Location of the service. - :vartype service_location: str + :param code: Required. + :type code: str + :param message: Required. + :type message: str """ _validation = { - 'destination_location': {'readonly': True}, - 'service_location': {'readonly': True}, + 'code': {'required': True}, + 'message': {'required': True}, } _attribute_map = { - 'destination_location': {'key': 'destinationLocation', 'type': 'str'}, - 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, **kwargs): - super(DestinationToServiceLocationMap, self).__init__(**kwargs) - self.destination_location = None - self.service_location = None + def __init__( + self, + **kwargs + ): + super(Details, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1690,14 +2025,16 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str - :param expected_data_size_in_terabytes: Required. The expected size of the - data, which needs to be transferred in this job, in terabytes. + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str + :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to + be transferred in this job, in terabytes. :type expected_data_size_in_terabytes: int """ @@ -1710,25 +2047,28 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DiskScheduleAvailabilityRequest, self).__init__(**kwargs) - self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) - self.sku_name = 'DataBoxDisk' + self.sku_name = 'DataBoxDisk' # type: str + self.expected_data_size_in_terabytes = kwargs['expected_data_size_in_terabytes'] -class DiskSecret(Model): +class DiskSecret(msrest.serialization.Model): """Contains all the secrets of a Disk. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar disk_serial_number: Serial number of the assigned disk. :vartype disk_serial_number: str - :ivar bit_locker_key: Bit Locker key of the disk which can be used to - unlock the disk to copy data. + :ivar bit_locker_key: Bit Locker key of the disk which can be used to unlock the disk to copy + data. :vartype bit_locker_key: str """ @@ -1742,327 +2082,468 @@ class DiskSecret(Model): 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DiskSecret, self).__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None -class Error(Model): - """Top level error for the job. +class EncryptionPreferences(msrest.serialization.Model): + """Preferences related to the Encryption. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: Error code that can be used to programmatically identify the - error. - :vartype code: str - :ivar message: Describes the error in detail and provides debugging - information. - :vartype message: str + :param double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". + :type double_encryption: str or ~data_box_management_client.models.DoubleEncryption """ - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'double_encryption': {'key': 'doubleEncryption', 'type': 'str'}, } - def __init__(self, **kwargs): - super(Error, self).__init__(**kwargs) - self.code = None - self.message = None + def __init__( + self, + **kwargs + ): + super(EncryptionPreferences, self).__init__(**kwargs) + self.double_encryption = kwargs.get('double_encryption', None) -class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling heavy orders. +class ErrorDetail(msrest.serialization.Model): + """ErrorDetail. All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 - :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param code: Required. + :type code: str + :param message: Required. + :type message: str + :param details: + :type details: list[~data_box_management_client.models.Details] + :param target: + :type target: str """ _validation = { - 'storage_location': {'required': True}, - 'sku_name': {'required': True}, + 'code': {'required': True}, + 'message': {'required': True}, } _attribute_map = { - 'storage_location': {'key': 'storageLocation', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Details]'}, + 'target': {'key': 'target', 'type': 'str'}, } - def __init__(self, **kwargs): - super(HeavyScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBoxHeavy' + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] + self.details = kwargs.get('details', None) + self.target = kwargs.get('target', None) -class JobDeliveryInfo(Model): - """Additional delivery info. +class FilterFileDetails(msrest.serialization.Model): + """Details of the filter files to be used for data transfer. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: datetime + All required parameters must be populated in order to send to Azure. + + :param filter_file_type: Required. Type of the filter file. Possible values include: + "AzureBlob", "AzureFile". + :type filter_file_type: str or ~data_box_management_client.models.FilterFileType + :param filter_file_path: Required. Path of the file that contains the details of all items to + transfer. + :type filter_file_path: str """ + _validation = { + 'filter_file_type': {'required': True}, + 'filter_file_path': {'required': True}, + } + _attribute_map = { - 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, + 'filter_file_type': {'key': 'filterFileType', 'type': 'str'}, + 'filter_file_path': {'key': 'filterFilePath', 'type': 'str'}, } - def __init__(self, **kwargs): - super(JobDeliveryInfo, self).__init__(**kwargs) - self.scheduled_date_time = kwargs.get('scheduled_date_time', None) + def __init__( + self, + **kwargs + ): + super(FilterFileDetails, self).__init__(**kwargs) + self.filter_file_type = kwargs['filter_file_type'] + self.filter_file_path = kwargs['filter_file_path'] -class JobErrorDetails(Model): - """Job Error Details for providing the information and recommended action. +class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): + """Request body to get the availability for scheduling heavy orders. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar error_message: Message for the error. - :vartype error_message: str - :ivar error_code: Code for the error. - :vartype error_code: int - :ivar recommended_action: Recommended action for the error. - :vartype recommended_action: str - :ivar exception_message: Contains the non localized exception message - :vartype exception_message: str + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :type storage_location: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { - 'error_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'recommended_action': {'readonly': True}, - 'exception_message': {'readonly': True}, + 'storage_location': {'required': True}, + 'sku_name': {'required': True}, } _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'exception_message': {'key': 'exceptionMessage', 'type': 'str'}, + 'storage_location': {'key': 'storageLocation', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } - def __init__(self, **kwargs): - super(JobErrorDetails, self).__init__(**kwargs) - self.error_message = None - self.error_code = None - self.recommended_action = None - self.exception_message = None + def __init__( + self, + **kwargs + ): + super(HeavyScheduleAvailabilityRequest, self).__init__(**kwargs) + self.sku_name = 'DataBoxHeavy' # type: str -class Resource(Model): +class Resource(msrest.serialization.Model): """Model of the Resource. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one - of the supported and registered Azure Regions (e.g. West US, East US, - Southeast Asia, etc.). The region of a resource cannot be changed once it - is created, but if an identical region is specified on update the request - will succeed. + :param location: Required. The location of the resource. This will be one of the supported and + registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. :type location: str - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :type sku: ~data_box_management_client.models.Sku + :param type: Identity type. + :type type: str + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, + ~data_box_management_client.models.UserAssignedIdentity] """ _validation = { 'location': {'required': True}, 'sku': {'required': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, } _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'type': {'key': 'identity.type', 'type': 'str'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) - self.location = kwargs.get('location', None) + self.location = kwargs['location'] self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.sku = kwargs['sku'] + self.type = kwargs.get('type', None) + self.principal_id = None + self.tenant_id = None + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) class JobResource(Resource): """Job Resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one - of the supported and registered Azure Regions (e.g. West US, East US, - Southeast Asia, etc.). The region of a resource cannot be changed once it - is created, but if an identical region is specified on update the request - will succeed. + :param location: Required. The location of the resource. This will be one of the supported and + registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. :type location: str - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :type sku: ~data_box_management_client.models.Sku + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, + ~data_box_management_client.models.UserAssignedIdentity] + :ivar name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param transfer_type: Required. Type of the data transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType :ivar is_cancellable: Describes whether the job is cancellable or not. :vartype is_cancellable: bool :ivar is_deletable: Describes whether the job is deletable or not. :vartype is_deletable: bool - :ivar is_shipping_address_editable: Describes whether the shipping address - is editable or not. + :ivar is_shipping_address_editable: Describes whether the shipping address is editable or not. :vartype is_shipping_address_editable: bool - :ivar status: Name of the stage which is in progress. Possible values - include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', - 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', - 'Cancelled', 'Failed_IssueReportedAtCustomer', - 'Failed_IssueDetectedAtAzureDC', 'Aborted', 'CompletedWithWarnings', - 'ReadyToDispatchFromAzureDC', 'ReadyToReceiveAtAzureDC' - :vartype status: str or ~azure.mgmt.databox.models.StageName - :ivar start_time: Time at which the job was started in UTC ISO 8601 - format. - :vartype start_time: datetime + :ivar is_prepare_to_ship_enabled: Is Prepare To Ship Enabled on this job. + :vartype is_prepare_to_ship_enabled: bool + :ivar status: Name of the stage which is in progress. Possible values include: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". + :vartype status: str or ~data_box_management_client.models.StageName + :ivar start_time: Time at which the job was started in UTC ISO 8601 format. + :vartype start_time: ~datetime.datetime :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.Error - :param details: Details of a job run. This field will only be sent for - expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~data_box_management_client.models.CloudError + :param details: Details of a job run. This field will only be sent for expand details filter. + :type details: ~data_box_management_client.models.JobDetails :ivar cancellation_reason: Reason for cancellation. :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: - 'NonScheduled', 'Scheduled' - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of - scheduled job. + :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". + :type delivery_type: str or ~data_box_management_client.models.JobDeliveryType + :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. :vartype is_cancellable_without_fee: bool - :ivar name: Name of the object. - :vartype name: str - :ivar id: Id of the object. - :vartype id: str - :ivar type: Type of the object. - :vartype type: str + :param scheduled_date_time: Scheduled date time. + :type scheduled_date_time: ~datetime.datetime """ _validation = { 'location': {'required': True}, 'sku': {'required': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'transfer_type': {'required': True}, 'is_cancellable': {'readonly': True}, 'is_deletable': {'readonly': True}, 'is_shipping_address_editable': {'readonly': True}, + 'is_prepare_to_ship_enabled': {'readonly': True}, 'status': {'readonly': True}, 'start_time': {'readonly': True}, 'error': {'readonly': True}, 'cancellation_reason': {'readonly': True}, 'is_cancellable_without_fee': {'readonly': True}, - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, } _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'transfer_type': {'key': 'properties.transferType', 'type': 'str'}, 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, 'is_deletable': {'key': 'properties.isDeletable', 'type': 'bool'}, 'is_shipping_address_editable': {'key': 'properties.isShippingAddressEditable', 'type': 'bool'}, - 'status': {'key': 'properties.status', 'type': 'StageName'}, + 'is_prepare_to_ship_enabled': {'key': 'properties.isPrepareToShipEnabled', 'type': 'bool'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'error': {'key': 'properties.error', 'type': 'Error'}, + 'error': {'key': 'properties.error', 'type': 'CloudError'}, 'details': {'key': 'properties.details', 'type': 'JobDetails'}, 'cancellation_reason': {'key': 'properties.cancellationReason', 'type': 'str'}, - 'delivery_type': {'key': 'properties.deliveryType', 'type': 'JobDeliveryType'}, - 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'JobDeliveryInfo'}, + 'delivery_type': {'key': 'properties.deliveryType', 'type': 'str'}, 'is_cancellable_without_fee': {'key': 'properties.isCancellableWithoutFee', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'scheduled_date_time': {'key': 'deliveryInfo.scheduledDateTime', 'type': 'iso-8601'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(JobResource, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.transfer_type = kwargs['transfer_type'] self.is_cancellable = None self.is_deletable = None self.is_shipping_address_editable = None + self.is_prepare_to_ship_enabled = None self.status = None self.start_time = None self.error = None self.details = kwargs.get('details', None) self.cancellation_reason = None self.delivery_type = kwargs.get('delivery_type', None) - self.delivery_info = kwargs.get('delivery_info', None) self.is_cancellable_without_fee = None - self.name = None - self.id = None - self.type = None + self.scheduled_date_time = kwargs.get('scheduled_date_time', None) + + +class JobResourceList(msrest.serialization.Model): + """Job Resource Collection. + + :param value: List of job resources. + :type value: list[~data_box_management_client.models.JobResource] + :param next_link: Link for the next set of job resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + def __init__( + self, + **kwargs + ): + super(JobResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) -class JobResourceUpdateParameter(Model): + +class JobResourceUpdateParameter(msrest.serialization.Model): """The JobResourceUpdateParameter. - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param kek_type: Type of encryption key used for key encryption. Possible values include: + "MicrosoftManaged", "CustomerManaged". + :type kek_type: str or ~data_box_management_client.models.KekType + :param kek_url: Key encryption key. It is required in case of Customer managed KekType. + :type kek_url: str + :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + KekType. + :type kek_vault_resource_id: str + :param type_details_key_encryption_key_identity_properties_type: Managed service identity type. + :type type_details_key_encryption_key_identity_properties_type: str + :param user_assigned: User assigned identity properties. + :type user_assigned: ~data_box_management_client.models.UserAssignedProperties + :param contact_name: Contact name of the person. + :type contact_name: str + :param phone: Phone number of the contact person. + :type phone: str + :param phone_extension: Phone extension number of the contact person. + :type phone_extension: str + :param mobile: Mobile number of the contact person. + :type mobile: str + :param email_list: List of Email-ids to be notified about job progress. + :type email_list: list[str] + :param notification_preference: Notification preference for a job stage. + :type notification_preference: list[~data_box_management_client.models.NotificationPreference] + :param type_identity_type: Identity type. + :type type_identity_type: str + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, + ~data_box_management_client.models.UserAssignedIdentity] """ - _attribute_map = { - 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, - 'destination_account_details': {'key': 'properties.destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, } - def __init__(self, **kwargs): + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'shipping_address': {'key': 'details.shippingAddress', 'type': 'ShippingAddress'}, + 'kek_type': {'key': 'details.keyEncryptionKey.kekType', 'type': 'str'}, + 'kek_url': {'key': 'details.keyEncryptionKey.kekUrl', 'type': 'str'}, + 'kek_vault_resource_id': {'key': 'details.keyEncryptionKey.kekVaultResourceID', 'type': 'str'}, + 'type_details_key_encryption_key_identity_properties_type': {'key': 'details.keyEncryptionKey.identityProperties.type', 'type': 'str'}, + 'user_assigned': {'key': 'details.keyEncryptionKey.identityProperties.userAssigned', 'type': 'UserAssignedProperties'}, + 'contact_name': {'key': 'details.contactDetails.contactName', 'type': 'str'}, + 'phone': {'key': 'details.contactDetails.phone', 'type': 'str'}, + 'phone_extension': {'key': 'details.contactDetails.phoneExtension', 'type': 'str'}, + 'mobile': {'key': 'details.contactDetails.mobile', 'type': 'str'}, + 'email_list': {'key': 'details.contactDetails.emailList', 'type': '[str]'}, + 'notification_preference': {'key': 'details.contactDetails.notificationPreference', 'type': '[NotificationPreference]'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + **kwargs + ): super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.details = kwargs.get('details', None) - self.destination_account_details = kwargs.get('destination_account_details', None) self.tags = kwargs.get('tags', None) + self.shipping_address = kwargs.get('shipping_address', None) + self.kek_type = kwargs.get('kek_type', None) + self.kek_url = kwargs.get('kek_url', None) + self.kek_vault_resource_id = kwargs.get('kek_vault_resource_id', None) + self.type_details_key_encryption_key_identity_properties_type = kwargs.get('type_details_key_encryption_key_identity_properties_type', None) + self.user_assigned = kwargs.get('user_assigned', None) + self.contact_name = kwargs.get('contact_name', None) + self.phone = kwargs.get('phone', None) + self.phone_extension = kwargs.get('phone_extension', None) + self.mobile = kwargs.get('mobile', None) + self.email_list = kwargs.get('email_list', None) + self.notification_preference = kwargs.get('notification_preference', None) + self.type_identity_type = kwargs.get('type_identity_type', None) + self.principal_id = None + self.tenant_id = None + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) -class JobStages(Model): +class JobStages(msrest.serialization.Model): """Job stages. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar stage_name: Name of the job stage. Possible values include: - 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', - 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', - 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', - 'Aborted', 'CompletedWithWarnings', 'ReadyToDispatchFromAzureDC', - 'ReadyToReceiveAtAzureDC' - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + :ivar stage_name: Name of the job stage. Possible values include: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". + :vartype stage_name: str or ~data_box_management_client.models.StageName :ivar display_name: Display name of the job stage. :vartype display_name: str - :ivar stage_status: Status of the job stage. Possible values include: - 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', 'Cancelling', - 'SucceededWithErrors' - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", + "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", + "WaitingForCustomerAction", "SucceededWithWarnings". + :vartype stage_status: str or ~data_box_management_client.models.StageStatus :ivar stage_time: Time for the job stage in UTC ISO 8601 format. - :vartype stage_time: datetime - :ivar job_stage_details: Job Stage Details + :vartype stage_time: ~datetime.datetime + :ivar job_stage_details: Job Stage Details. :vartype job_stage_details: object - :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] """ _validation = { @@ -2071,37 +2552,124 @@ class JobStages(Model): 'stage_status': {'readonly': True}, 'stage_time': {'readonly': True}, 'job_stage_details': {'readonly': True}, - 'error_details': {'readonly': True}, } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'StageName'}, + 'stage_name': {'key': 'stageName', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, - 'stage_status': {'key': 'stageStatus', 'type': 'StageStatus'}, + 'stage_status': {'key': 'stageStatus', 'type': 'str'}, 'stage_time': {'key': 'stageTime', 'type': 'iso-8601'}, 'job_stage_details': {'key': 'jobStageDetails', 'type': 'object'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(JobStages, self).__init__(**kwargs) self.stage_name = None self.display_name = None self.stage_status = None self.stage_time = None self.job_stage_details = None - self.error_details = None -class NotificationPreference(Model): +class KeyEncryptionKey(msrest.serialization.Model): + """Encryption key containing details about key to encrypt different keys. + + All required parameters must be populated in order to send to Azure. + + :param kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". + :type kek_type: str or ~data_box_management_client.models.KekType + :param kek_url: Key encryption key. It is required in case of Customer managed KekType. + :type kek_url: str + :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + KekType. + :type kek_vault_resource_id: str + :param type: Managed service identity type. + :type type: str + :param user_assigned: User assigned identity properties. + :type user_assigned: ~data_box_management_client.models.UserAssignedProperties + """ + + _validation = { + 'kek_type': {'required': True}, + } + + _attribute_map = { + 'kek_type': {'key': 'kekType', 'type': 'str'}, + 'kek_url': {'key': 'kekUrl', 'type': 'str'}, + 'kek_vault_resource_id': {'key': 'kekVaultResourceID', 'type': 'str'}, + 'type': {'key': 'identityProperties.type', 'type': 'str'}, + 'user_assigned': {'key': 'identityProperties.userAssigned', 'type': 'UserAssignedProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyEncryptionKey, self).__init__(**kwargs) + self.kek_type = kwargs['kek_type'] + self.kek_url = kwargs.get('kek_url', None) + self.kek_vault_resource_id = kwargs.get('kek_vault_resource_id', None) + self.type = kwargs.get('type', None) + self.user_assigned = kwargs.get('user_assigned', None) + + +class ManagedDiskDetails(DataAccountDetails): + """Details of the managed disks. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str + :param resource_group_id: Required. Resource Group Id of the compute disks. + :type resource_group_id: str + :param staging_storage_account_id: Required. Resource Id of the storage account that can be + used to copy the vhd for staging. + :type staging_storage_account_id: str + """ + + _validation = { + 'data_account_type': {'required': True}, + 'resource_group_id': {'required': True}, + 'staging_storage_account_id': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, + 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, + 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedDiskDetails, self).__init__(**kwargs) + self.data_account_type = 'ManagedDisk' # type: str + self.resource_group_id = kwargs['resource_group_id'] + self.staging_storage_account_id = kwargs['staging_storage_account_id'] + + +class NotificationPreference(msrest.serialization.Model): """Notification preference for a job stage. All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: - 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', - 'DataCopy' - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName + :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". + :type stage_name: str or ~data_box_management_client.models.NotificationStageName :param send_notification: Required. Notification is required or not. :type send_notification: bool """ @@ -2112,31 +2680,35 @@ class NotificationPreference(Model): } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'NotificationStageName'}, + 'stage_name': {'key': 'stageName', 'type': 'str'}, 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(NotificationPreference, self).__init__(**kwargs) - self.stage_name = kwargs.get('stage_name', None) - self.send_notification = kwargs.get('send_notification', None) + self.stage_name = kwargs['stage_name'] + self.send_notification = kwargs['send_notification'] -class Operation(Model): +class Operation(msrest.serialization.Model): """Operation entity. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the operation. Format: - {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~data_box_management_client.models.OperationDisplay :ivar properties: Operation properties. :vartype properties: object - :ivar origin: Origin of the operation. Can be : user|system|user,system + :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool """ _validation = { @@ -2151,17 +2723,22 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'properties': {'key': 'properties', 'type': 'object'}, 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Operation, self).__init__(**kwargs) self.name = None self.display = None self.properties = None self.origin = None + self.is_data_action = kwargs.get('is_data_action', None) -class OperationDisplay(Model): +class OperationDisplay(msrest.serialization.Model): """Operation display. :param provider: Provider name. @@ -2170,8 +2747,7 @@ class OperationDisplay(Model): :type resource: str :param operation: Localized name of the operation for display purpose. :type operation: str - :param description: Localized description of the operation for display - purpose. + :param description: Localized description of the operation for display purpose. :type description: str """ @@ -2182,7 +2758,10 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationDisplay, self).__init__(**kwargs) self.provider = kwargs.get('provider', None) self.resource = kwargs.get('resource', None) @@ -2190,11 +2769,39 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) -class PackageShippingDetails(Model): +class OperationList(msrest.serialization.Model): + """Operation Collection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations. + :vartype value: list[~data_box_management_client.models.Operation] + :param next_link: Link for the next set of operations. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class PackageShippingDetails(msrest.serialization.Model): """Shipping details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar carrier_name: Name of the carrier. :vartype carrier_name: str @@ -2216,33 +2823,41 @@ class PackageShippingDetails(Model): 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(PackageShippingDetails, self).__init__(**kwargs) self.carrier_name = None self.tracking_id = None self.tracking_url = None -class Preferences(Model): +class Preferences(msrest.serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred Data Center Region. + :param preferred_data_center_region: Preferred data center region. :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment - logistics of the sku. - :type transport_preferences: - ~azure.mgmt.databox.models.TransportPreferences + :param transport_preferences: Preferences related to the shipment logistics of the sku. + :type transport_preferences: ~data_box_management_client.models.TransportPreferences + :param encryption_preferences: Preferences related to the Encryption. + :type encryption_preferences: ~data_box_management_client.models.EncryptionPreferences """ _attribute_map = { 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, + 'encryption_preferences': {'key': 'encryptionPreferences', 'type': 'EncryptionPreferences'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Preferences, self).__init__(**kwargs) self.preferred_data_center_region = kwargs.get('preferred_data_center_region', None) self.transport_preferences = kwargs.get('transport_preferences', None) + self.encryption_preferences = kwargs.get('encryption_preferences', None) class PreferencesValidationRequest(ValidationInputRequest): @@ -2250,14 +2865,16 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param preference: Preference requested with respect to transport type and - data center - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param preference: Preference of transport and data center. + :type preference: ~data_box_management_client.models.Preferences + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName """ _validation = { @@ -2268,89 +2885,96 @@ class PreferencesValidationRequest(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, 'preference': {'key': 'preference', 'type': 'Preferences'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(PreferencesValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidatePreferences' # type: str self.preference = kwargs.get('preference', None) - self.device_type = kwargs.get('device_type', None) - self.validation_type = 'ValidatePreferences' + self.device_type = kwargs['device_type'] class PreferencesValidationResponseProperties(ValidationInputResponse): """Properties of data center and transport preference validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Validation status of requested data center and transport. - Possible values include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Validation status of requested data center and transport. Possible values + include: "Valid", "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(PreferencesValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidatePreferences' # type: str self.status = None - self.validation_type = 'ValidatePreferences' -class RegionConfigurationRequest(Model): +class RegionConfigurationRequest(msrest.serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability - for scheduling orders. + :param schedule_availability_request: Request body to get the availability for scheduling + orders. :type schedule_availability_request: - ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport - availability for given sku. - :type transport_availability_request: - ~azure.mgmt.databox.models.TransportAvailabilityRequest + ~data_box_management_client.models.ScheduleAvailabilityRequest + :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName """ _attribute_map = { 'schedule_availability_request': {'key': 'scheduleAvailabilityRequest', 'type': 'ScheduleAvailabilityRequest'}, - 'transport_availability_request': {'key': 'transportAvailabilityRequest', 'type': 'TransportAvailabilityRequest'}, + 'sku_name': {'key': 'transportAvailabilityRequest.skuName', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(RegionConfigurationRequest, self).__init__(**kwargs) self.schedule_availability_request = kwargs.get('schedule_availability_request', None) - self.transport_availability_request = kwargs.get('transport_availability_request', None) + self.sku_name = kwargs.get('sku_name', None) -class RegionConfigurationResponse(Model): +class RegionConfigurationResponse(msrest.serialization.Model): """Configuration response specific to a region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar schedule_availability_response: Schedule availability for given sku - in a region. + :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for - given sku in a region. + ~data_box_management_client.models.ScheduleAvailabilityResponse + :ivar transport_availability_response: Transport options available for given sku in a region. :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse + ~data_box_management_client.models.TransportAvailabilityResponse """ _validation = { @@ -2363,20 +2987,22 @@ class RegionConfigurationResponse(Model): 'transport_availability_response': {'key': 'transportAvailabilityResponse', 'type': 'TransportAvailabilityResponse'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(RegionConfigurationResponse, self).__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None -class ScheduleAvailabilityResponse(Model): - """Schedule availability response for given sku in a region. +class ScheduleAvailabilityResponse(msrest.serialization.Model): + """Schedule availability for given sku in a region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar available_dates: List of dates available to schedule - :vartype available_dates: list[datetime] + :ivar available_dates: List of dates available to schedule. + :vartype available_dates: list[~datetime.datetime] """ _validation = { @@ -2387,31 +3013,31 @@ class ScheduleAvailabilityResponse(Model): 'available_dates': {'key': 'availableDates', 'type': '[iso-8601]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ScheduleAvailabilityResponse, self).__init__(**kwargs) self.available_dates = None -class ShareCredentialDetails(Model): +class ShareCredentialDetails(msrest.serialization.Model): """Credential details of the shares in account. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar share_name: Name of the share. :vartype share_name: str - :ivar share_type: Type of the share. Possible values include: - 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile', 'ManagedDisk' - :vartype share_type: str or - ~azure.mgmt.databox.models.ShareDestinationFormatType + :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", + "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk", "AzurePremiumFiles". + :vartype share_type: str or ~data_box_management_client.models.ShareDestinationFormatType :ivar user_name: User name for the share. :vartype user_name: str :ivar password: Password for the share. :vartype password: str - :ivar supported_access_protocols: Access protocols supported on the - device. + :ivar supported_access_protocols: Access protocols supported on the device. :vartype supported_access_protocols: list[str or - ~azure.mgmt.databox.models.AccessProtocol] + ~data_box_management_client.models.AccessProtocol] """ _validation = { @@ -2424,13 +3050,16 @@ class ShareCredentialDetails(Model): _attribute_map = { 'share_name': {'key': 'shareName', 'type': 'str'}, - 'share_type': {'key': 'shareType', 'type': 'ShareDestinationFormatType'}, + 'share_type': {'key': 'shareType', 'type': 'str'}, 'user_name': {'key': 'userName', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, - 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[AccessProtocol]'}, + 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ShareCredentialDetails, self).__init__(**kwargs) self.share_name = None self.share_type = None @@ -2439,19 +3068,18 @@ def __init__(self, **kwargs): self.supported_access_protocols = None -class ShipmentPickUpRequest(Model): +class ShipmentPickUpRequest(msrest.serialization.Model): """Shipment pick up request details. All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should - commence, this must be in local time of pick up area. - :type start_time: datetime - :param end_time: Required. Maximum date before which the pick up should - commence, this must be in local time of pick up area. - :type end_time: datetime - :param shipment_location: Required. Shipment Location in the pickup place. - Eg.front desk + :param start_time: Required. Minimum date after which the pick up should commence, this must be + in local time of pick up area. + :type start_time: ~datetime.datetime + :param end_time: Required. Maximum date before which the pick up should commence, this must be + in local time of pick up area. + :type end_time: ~datetime.datetime + :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. :type shipment_location: str """ @@ -2467,24 +3095,26 @@ class ShipmentPickUpRequest(Model): 'shipment_location': {'key': 'shipmentLocation', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ShipmentPickUpRequest, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.end_time = kwargs.get('end_time', None) - self.shipment_location = kwargs.get('shipment_location', None) + self.start_time = kwargs['start_time'] + self.end_time = kwargs['end_time'] + self.shipment_location = kwargs['shipment_location'] -class ShipmentPickUpResponse(Model): +class ShipmentPickUpResponse(msrest.serialization.Model): """Shipment pick up response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar confirmation_number: Confirmation number for the pick up request. :vartype confirmation_number: str - :ivar ready_by_time: Time by which shipment should be ready for pick up, - this is in local time of pick up area. - :vartype ready_by_time: datetime + :ivar ready_by_time: Time by which shipment should be ready for pick up, this is in local time + of pick up area. + :vartype ready_by_time: ~datetime.datetime """ _validation = { @@ -2497,13 +3127,16 @@ class ShipmentPickUpResponse(Model): 'ready_by_time': {'key': 'readyByTime', 'type': 'iso-8601'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ShipmentPickUpResponse, self).__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None -class ShippingAddress(Model): +class ShippingAddress(msrest.serialization.Model): """Shipping address where customer wishes to receive the device. All required parameters must be populated in order to send to Azure. @@ -2520,21 +3153,20 @@ class ShippingAddress(Model): :type state_or_province: str :param country: Required. Name of the Country. :type country: str - :param postal_code: Required. Postal code. + :param postal_code: Postal code. :type postal_code: str :param zip_extended_code: Extended Zip Code. :type zip_extended_code: str :param company_name: Name of the company. :type company_name: str - :param address_type: Type of address. Possible values include: 'None', - 'Residential', 'Commercial' - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :param address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". + :type address_type: str or ~data_box_management_client.models.AddressType """ _validation = { 'street_address1': {'required': True}, 'country': {'required': True}, - 'postal_code': {'required': True}, } _attribute_map = { @@ -2547,31 +3179,34 @@ class ShippingAddress(Model): 'postal_code': {'key': 'postalCode', 'type': 'str'}, 'zip_extended_code': {'key': 'zipExtendedCode', 'type': 'str'}, 'company_name': {'key': 'companyName', 'type': 'str'}, - 'address_type': {'key': 'addressType', 'type': 'AddressType'}, + 'address_type': {'key': 'addressType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ShippingAddress, self).__init__(**kwargs) - self.street_address1 = kwargs.get('street_address1', None) + self.street_address1 = kwargs['street_address1'] self.street_address2 = kwargs.get('street_address2', None) self.street_address3 = kwargs.get('street_address3', None) self.city = kwargs.get('city', None) self.state_or_province = kwargs.get('state_or_province', None) - self.country = kwargs.get('country', None) + self.country = kwargs['country'] self.postal_code = kwargs.get('postal_code', None) self.zip_extended_code = kwargs.get('zip_extended_code', None) self.company_name = kwargs.get('company_name', None) self.address_type = kwargs.get('address_type', None) -class Sku(Model): +class Sku(msrest.serialization.Model): """The Sku. All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: 'DataBox', - 'DataBoxDisk', 'DataBoxHeavy' - :type name: str or ~azure.mgmt.databox.models.SkuName + :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type name: str or ~data_box_management_client.models.SkuName :param display_name: The display name of the sku. :type display_name: str :param family: The sku family. @@ -2583,14 +3218,17 @@ class Sku(Model): } _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, + 'name': {'key': 'name', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] self.display_name = kwargs.get('display_name', None) self.family = kwargs.get('family', None) @@ -2598,95 +3236,99 @@ def __init__(self, **kwargs): class SkuAvailabilityValidationRequest(ValidationInputRequest): """Request to validate sku availability. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar transfer_type: Required. Type of the transfer. Default value: - "ImportToAzure" . - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. - For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType + :param country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. :type country: str - :param location: Required. Location for data transfer. For locations - check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type location: str """ _validation = { 'validation_type': {'required': True}, 'device_type': {'required': True}, - 'transfer_type': {'required': True, 'constant': True}, + 'transfer_type': {'required': True}, 'country': {'required': True}, 'location': {'required': True}, } _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, 'transfer_type': {'key': 'transferType', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, } - transfer_type = "ImportToAzure" - - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) - self.device_type = kwargs.get('device_type', None) - self.country = kwargs.get('country', None) - self.location = kwargs.get('location', None) - self.validation_type = 'ValidateSkuAvailability' + self.validation_type = 'ValidateSkuAvailability' # type: str + self.device_type = kwargs['device_type'] + self.transfer_type = kwargs['transfer_type'] + self.country = kwargs['country'] + self.location = kwargs['location'] class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): """Properties of sku availability validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Sku availability validation status. Possible values include: - 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", + "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateSkuAvailability' # type: str self.status = None - self.validation_type = 'ValidateSkuAvailability' -class SkuCapacity(Model): +class SkuCapacity(msrest.serialization.Model): """Capacity of the sku. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar usable: Usable capacity in TB. :vartype usable: str @@ -2704,65 +3346,73 @@ class SkuCapacity(Model): 'maximum': {'key': 'maximum', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SkuCapacity, self).__init__(**kwargs) self.usable = None self.maximum = None -class SkuCost(Model): +class SkuCost(msrest.serialization.Model): """Describes metadata for retrieving price info. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar meter_id: Meter id of the Sku. :vartype meter_id: str :ivar meter_type: The type of the meter. :vartype meter_type: str + :ivar multiplier: Multiplier specifies the region specific value to be multiplied with 1$ guid. + Eg: Our new regions will be using 1$ shipping guid with appropriate multiplier specific to + region. + :vartype multiplier: float """ _validation = { 'meter_id': {'readonly': True}, 'meter_type': {'readonly': True}, + 'multiplier': {'readonly': True}, } _attribute_map = { 'meter_id': {'key': 'meterId', 'type': 'str'}, 'meter_type': {'key': 'meterType', 'type': 'str'}, + 'multiplier': {'key': 'multiplier', 'type': 'float'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SkuCost, self).__init__(**kwargs) self.meter_id = None self.meter_type = None + self.multiplier = None -class SkuInformation(Model): +class SkuInformation(msrest.serialization.Model): """Information of the sku. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :vartype sku: ~data_box_management_client.models.Sku :ivar enabled: The sku is enabled or not. :vartype enabled: bool - :ivar destination_to_service_location_map: The map of destination location - to service location. - :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.models.DestinationToServiceLocationMap] + :ivar data_location_to_service_location_map: The map of data location to service location. + :vartype data_location_to_service_location_map: + list[~data_box_management_client.models.DataLocationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~data_box_management_client.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :vartype costs: list[~data_box_management_client.models.SkuCost] :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] - :ivar disabled_reason: Reason why the Sku is disabled. Possible values - include: 'None', 'Country', 'Region', 'Feature', 'OfferType', - 'NoSubscriptionInfo' - :vartype disabled_reason: str or - ~azure.mgmt.databox.models.SkuDisabledReason + :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", + "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". + :vartype disabled_reason: str or ~data_box_management_client.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. :vartype disabled_reason_message: str :ivar required_feature: Required feature to access the sku. @@ -2772,7 +3422,7 @@ class SkuInformation(Model): _validation = { 'sku': {'readonly': True}, 'enabled': {'readonly': True}, - 'destination_to_service_location_map': {'readonly': True}, + 'data_location_to_service_location_map': {'readonly': True}, 'capacity': {'readonly': True}, 'costs': {'readonly': True}, 'api_versions': {'readonly': True}, @@ -2784,20 +3434,23 @@ class SkuInformation(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'destination_to_service_location_map': {'key': 'properties.destinationToServiceLocationMap', 'type': '[DestinationToServiceLocationMap]'}, + 'data_location_to_service_location_map': {'key': 'properties.dataLocationToServiceLocationMap', 'type': '[DataLocationToServiceLocationMap]'}, 'capacity': {'key': 'properties.capacity', 'type': 'SkuCapacity'}, 'costs': {'key': 'properties.costs', 'type': '[SkuCost]'}, 'api_versions': {'key': 'properties.apiVersions', 'type': '[str]'}, - 'disabled_reason': {'key': 'properties.disabledReason', 'type': 'SkuDisabledReason'}, + 'disabled_reason': {'key': 'properties.disabledReason', 'type': 'str'}, 'disabled_reason_message': {'key': 'properties.disabledReasonMessage', 'type': 'str'}, 'required_feature': {'key': 'properties.requiredFeature', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SkuInformation, self).__init__(**kwargs) self.sku = None self.enabled = None - self.destination_to_service_location_map = None + self.data_location_to_service_location_map = None self.capacity = None self.costs = None self.api_versions = None @@ -2806,13 +3459,55 @@ def __init__(self, **kwargs): self.required_feature = None +class StorageAccountDetails(DataAccountDetails): + """Details for the storage account. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str + :param storage_account_id: Required. Storage Account Resource Id. + :type storage_account_id: str + """ + + _validation = { + 'data_account_type': {'required': True}, + 'storage_account_id': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountDetails, self).__init__(**kwargs) + self.data_account_type = 'StorageAccount' # type: str + self.storage_account_id = kwargs['storage_account_id'] + + class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): """Request to validate subscription permission to create jobs. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator """ _validation = { @@ -2823,98 +3518,237 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): 'validation_type': {'key': 'validationType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' + self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): """Properties of subscription permission to create job validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Validation status of subscription permission to create job. - Possible values include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Validation status of subscription permission to create job. Possible values + include: "Valid", "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str self.status = None - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' -class TransportAvailabilityDetails(Model): - """Transport options availability details for given region. +class TransferAllDetails(msrest.serialization.Model): + """Details to transfer all data. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar shipment_type: Transport Shipment Type supported for given region. - Possible values include: 'CustomerManaged', 'MicrosoftManaged' - :vartype shipment_type: str or - ~azure.mgmt.databox.models.TransportShipmentTypes + :param data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :type transfer_all_blobs: bool + :param transfer_all_files: To indicate if all Azure Files have to be transferred. + :type transfer_all_files: bool """ _validation = { - 'shipment_type': {'readonly': True}, + 'data_account_type': {'required': True}, } _attribute_map = { - 'shipment_type': {'key': 'shipmentType', 'type': 'TransportShipmentTypes'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'transfer_all_blobs': {'key': 'transferAllBlobs', 'type': 'bool'}, + 'transfer_all_files': {'key': 'transferAllFiles', 'type': 'bool'}, } - def __init__(self, **kwargs): - super(TransportAvailabilityDetails, self).__init__(**kwargs) - self.shipment_type = None + def __init__( + self, + **kwargs + ): + super(TransferAllDetails, self).__init__(**kwargs) + self.data_account_type = kwargs['data_account_type'] + self.transfer_all_blobs = kwargs.get('transfer_all_blobs', None) + self.transfer_all_files = kwargs.get('transfer_all_files', None) -class TransportAvailabilityRequest(Model): - """Request body to get the transport availability for given sku. +class TransferConfiguration(msrest.serialization.Model): + """Configuration for defining the transfer of data. + + All required parameters must be populated in order to send to Azure. - :param sku_name: Type of the device. Possible values include: 'DataBox', - 'DataBoxDisk', 'DataBoxHeavy' - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible + values include: "TransferAll", "TransferUsingFilter". + :type transfer_configuration_type: str or + ~data_box_management_client.models.TransferConfigurationType + :param transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :type transfer_filter_details: + ~data_box_management_client.models.TransferConfigurationTransferFilterDetails + :param transfer_all_details: Map of filter type and the details to transfer all data. This + field is required only if the TransferConfigurationType is given as TransferAll. + :type transfer_all_details: + ~data_box_management_client.models.TransferConfigurationTransferAllDetails """ + _validation = { + 'transfer_configuration_type': {'required': True}, + } + _attribute_map = { - 'sku_name': {'key': 'skuName', 'type': 'SkuName'}, + 'transfer_configuration_type': {'key': 'transferConfigurationType', 'type': 'str'}, + 'transfer_filter_details': {'key': 'transferFilterDetails', 'type': 'TransferConfigurationTransferFilterDetails'}, + 'transfer_all_details': {'key': 'transferAllDetails', 'type': 'TransferConfigurationTransferAllDetails'}, } - def __init__(self, **kwargs): - super(TransportAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = kwargs.get('sku_name', None) + def __init__( + self, + **kwargs + ): + super(TransferConfiguration, self).__init__(**kwargs) + self.transfer_configuration_type = kwargs['transfer_configuration_type'] + self.transfer_filter_details = kwargs.get('transfer_filter_details', None) + self.transfer_all_details = kwargs.get('transfer_all_details', None) + + +class TransferConfigurationTransferAllDetails(msrest.serialization.Model): + """Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll. + + :param include: Details to transfer all data. + :type include: ~data_box_management_client.models.TransferAllDetails + """ + + _attribute_map = { + 'include': {'key': 'include', 'type': 'TransferAllDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) + self.include = kwargs.get('include', None) + + +class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): + """Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. + + :param include: Details of the filtering the transfer of data. + :type include: ~data_box_management_client.models.TransferFilterDetails + """ + + _attribute_map = { + 'include': {'key': 'include', 'type': 'TransferFilterDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) + self.include = kwargs.get('include', None) + + +class TransferFilterDetails(msrest.serialization.Model): + """Details of the filtering the transfer of data. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param blob_filter_details: Filter details to transfer blobs. + :type blob_filter_details: ~data_box_management_client.models.BlobFilterDetails + :param azure_file_filter_details: Filter details to transfer Azure files. + :type azure_file_filter_details: ~data_box_management_client.models.AzureFileFilterDetails + :param filter_file_details: Details of the filter files to be used for data transfer. + :type filter_file_details: list[~data_box_management_client.models.FilterFileDetails] + """ + + _validation = { + 'data_account_type': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'blob_filter_details': {'key': 'blobFilterDetails', 'type': 'BlobFilterDetails'}, + 'azure_file_filter_details': {'key': 'azureFileFilterDetails', 'type': 'AzureFileFilterDetails'}, + 'filter_file_details': {'key': 'filterFileDetails', 'type': '[FilterFileDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(TransferFilterDetails, self).__init__(**kwargs) + self.data_account_type = kwargs['data_account_type'] + self.blob_filter_details = kwargs.get('blob_filter_details', None) + self.azure_file_filter_details = kwargs.get('azure_file_filter_details', None) + self.filter_file_details = kwargs.get('filter_file_details', None) + + +class TransportAvailabilityDetails(msrest.serialization.Model): + """Transport options availability details for given region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar shipment_type: Transport Shipment Type supported for given region. Possible values + include: "CustomerManaged", "MicrosoftManaged". + :vartype shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes + """ + + _validation = { + 'shipment_type': {'readonly': True}, + } + + _attribute_map = { + 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TransportAvailabilityDetails, self).__init__(**kwargs) + self.shipment_type = None -class TransportAvailabilityResponse(Model): +class TransportAvailabilityResponse(msrest.serialization.Model): """Transport options available for given sku in a region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar transport_availability_details: List of transport availability - details for given region + :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~data_box_management_client.models.TransportAvailabilityDetails] """ _validation = { @@ -2925,21 +3759,22 @@ class TransportAvailabilityResponse(Model): 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(TransportAvailabilityResponse, self).__init__(**kwargs) self.transport_availability_details = None -class TransportPreferences(Model): +class TransportPreferences(msrest.serialization.Model): """Preferences related to the shipment logistics of the sku. All required parameters must be populated in order to send to Azure. - :param preferred_shipment_type: Required. Indicates Shipment Logistics - type that the customer preferred. Possible values include: - 'CustomerManaged', 'MicrosoftManaged' - :type preferred_shipment_type: str or - ~azure.mgmt.databox.models.TransportShipmentTypes + :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". + :type preferred_shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes """ _validation = { @@ -2947,24 +3782,26 @@ class TransportPreferences(Model): } _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'TransportShipmentTypes'}, + 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(TransportPreferences, self).__init__(**kwargs) - self.preferred_shipment_type = kwargs.get('preferred_shipment_type', None) + self.preferred_shipment_type = kwargs['preferred_shipment_type'] -class UnencryptedCredentials(Model): +class UnencryptedCredentials(msrest.serialization.Model): """Unencrypted credentials for accessing device. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar job_name: Name of the job. :vartype job_name: str :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets + :vartype job_secrets: ~data_box_management_client.models.JobSecrets """ _validation = { @@ -2977,49 +3814,105 @@ class UnencryptedCredentials(Model): 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(UnencryptedCredentials, self).__init__(**kwargs) self.job_name = None self.job_secrets = None -class UpdateJobDetails(Model): - """Job details for update. +class UnencryptedCredentialsList(msrest.serialization.Model): + """List of unencrypted credentials for accessing device. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :param value: List of unencrypted credentials. + :type value: list[~data_box_management_client.models.UnencryptedCredentials] + :param next_link: Link for the next set of unencrypted credentials. + :type next_link: str """ _attribute_map = { - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, + 'value': {'key': 'value', 'type': '[UnencryptedCredentials]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, **kwargs): - super(UpdateJobDetails, self).__init__(**kwargs) - self.contact_details = kwargs.get('contact_details', None) - self.shipping_address = kwargs.get('shipping_address', None) + def __init__( + self, + **kwargs + ): + super(UnencryptedCredentialsList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class UserAssignedIdentity(msrest.serialization.Model): + """Class defining User assigned identity details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class UserAssignedProperties(msrest.serialization.Model): + """User assigned identity properties. + + :param resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :type resource_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedProperties, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) class ValidateAddress(ValidationInputRequest): - """The requirements to validate customer address where the device needs to be - shipped. + """The requirements to validate customer address where the device needs to be shipped. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment - logistics of the sku. - :type transport_preferences: - ~azure.mgmt.databox.models.TransportPreferences + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. + Possible values include: "CustomerManaged", "MicrosoftManaged". + :type preferred_shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes """ _validation = { @@ -3031,32 +3924,33 @@ class ValidateAddress(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, - 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'preferred_shipment_type': {'key': 'transportPreferences.preferredShipmentType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ValidateAddress, self).__init__(**kwargs) - self.shipping_address = kwargs.get('shipping_address', None) - self.device_type = kwargs.get('device_type', None) - self.transport_preferences = kwargs.get('transport_preferences', None) - self.validation_type = 'ValidateAddress' + self.validation_type = 'ValidateAddress' # type: str + self.shipping_address = kwargs['shipping_address'] + self.device_type = kwargs['device_type'] + self.preferred_shipment_type = kwargs.get('preferred_shipment_type', None) -class ValidationResponse(Model): +class ValidationResponse(msrest.serialization.Model): """Response of pre job creation validations. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: Overall validation status. Possible values include: - 'AllValidToProceed', 'InputsRevisitRequired', - 'CertainInputValidationsSkipped' - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus - :ivar individual_response_details: List of response details contain - validationType and its response as key and value respectively. + :ivar status: Overall validation status. Possible values include: "AllValidToProceed", + "InputsRevisitRequired", "CertainInputValidationsSkipped". + :vartype status: str or ~data_box_management_client.models.OverallValidationStatus + :ivar individual_response_details: List of response details contain validationType and its + response as key and value respectively. :vartype individual_response_details: - list[~azure.mgmt.databox.models.ValidationInputResponse] + list[~data_box_management_client.models.ValidationInputResponse] """ _validation = { @@ -3065,11 +3959,14 @@ class ValidationResponse(Model): } _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'OverallValidationStatus'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ValidationResponse, self).__init__(**kwargs) self.status = None self.individual_response_details = None diff --git a/src/databox/azext_databox/vendored_sdks/databox/models/_models_py3.py b/src/databox/azext_databox/vendored_sdks/databox/models/_models_py3.py index a96c0dc5c49..b8af8d3edbe 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/models/_models_py3.py +++ b/src/databox/azext_databox/vendored_sdks/databox/models/_models_py3.py @@ -1,76 +1,106 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import datetime +from typing import Dict, List, Optional, Union +from azure.core.exceptions import HttpResponseError +import msrest.serialization -class AccountCredentialDetails(Model): +from ._data_box_management_client_enums import * + + +class AccountCredentialDetails(msrest.serialization.Model): """Credential details of the account. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar account_name: Name of the account. :vartype account_name: str - :ivar data_destination_type: Data Destination Type. Possible values - include: 'StorageAccount', 'ManagedDisk' - :vartype data_destination_type: str or - ~azure.mgmt.databox.models.DataDestinationType - :ivar account_connection_string: Connection string of the account endpoint - to use the account as a storage endpoint on the device. + :ivar data_account_type: Type of the account. Possible values include: "StorageAccount", + "ManagedDisk". + :vartype data_account_type: str or ~data_box_management_client.models.DataAccountType + :ivar account_connection_string: Connection string of the account endpoint to use the account + as a storage endpoint on the device. :vartype account_connection_string: str - :ivar share_credential_details: Per share level unencrypted access - credentials. + :ivar share_credential_details: Per share level unencrypted access credentials. :vartype share_credential_details: - list[~azure.mgmt.databox.models.ShareCredentialDetails] + list[~data_box_management_client.models.ShareCredentialDetails] """ _validation = { 'account_name': {'readonly': True}, - 'data_destination_type': {'readonly': True}, + 'data_account_type': {'readonly': True}, 'account_connection_string': {'readonly': True}, 'share_credential_details': {'readonly': True}, } _attribute_map = { 'account_name': {'key': 'accountName', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'DataDestinationType'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, 'account_connection_string': {'key': 'accountConnectionString', 'type': 'str'}, 'share_credential_details': {'key': 'shareCredentialDetails', 'type': '[ShareCredentialDetails]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(AccountCredentialDetails, self).__init__(**kwargs) self.account_name = None - self.data_destination_type = None + self.data_account_type = None self.account_connection_string = None self.share_credential_details = None -class AddressValidationOutput(Model): +class AdditionalErrorInfo(msrest.serialization.Model): + """Additional error info. + + :param type: Additional error type. + :type type: str + :param info: Additional error info. + :type info: object + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + info: Optional[object] = None, + **kwargs + ): + super(AdditionalErrorInfo, self).__init__(**kwargs) + self.type = type + self.info = info + + +class AddressValidationOutput(msrest.serialization.Model): """Output of the address validation api. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. + :param validation_type: Identifies the type of validation response.Constant filled by server. + Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar validation_status: The address validation status. Possible values - include: 'Valid', 'Invalid', 'Ambiguous' - :vartype validation_status: str or - ~azure.mgmt.databox.models.AddressValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar validation_status: The address validation status. Possible values include: "Valid", + "Invalid", "Ambiguous". + :vartype validation_status: str or ~data_box_management_client.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: - list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~data_box_management_client.models.ShippingAddress] """ _validation = { @@ -80,23 +110,141 @@ class AddressValidationOutput(Model): } _attribute_map = { - 'error': {'key': 'properties.error', 'type': 'Error'}, - 'validation_status': {'key': 'properties.validationStatus', 'type': 'AddressValidationStatus'}, + 'validation_type': {'key': 'properties.validationType', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'CloudError'}, + 'validation_status': {'key': 'properties.validationStatus', 'type': 'str'}, 'alternate_addresses': {'key': 'properties.alternateAddresses', 'type': '[ShippingAddress]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(AddressValidationOutput, self).__init__(**kwargs) + self.validation_type = None # type: Optional[str] + self.error = None + self.validation_status = None + self.alternate_addresses = None + + +class ValidationInputResponse(msrest.serialization.Model): + """Minimum properties that should be present in each individual validation response. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, DataTransferDetailsValidationResponseProperties, PreferencesValidationResponseProperties, SkuAvailabilityValidationResponseProperties, SubscriptionIsAllowedToCreateJobValidationResponseProperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + } + + _subtype_map = { + 'validation_type': {'ValidateAddress': 'AddressValidationProperties', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} + } + + def __init__( + self, + **kwargs + ): + super(ValidationInputResponse, self).__init__(**kwargs) + self.validation_type = None # type: Optional[str] self.error = None + + +class AddressValidationProperties(ValidationInputResponse): + """The address validation output. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + :ivar validation_status: The address validation status. Possible values include: "Valid", + "Invalid", "Ambiguous". + :vartype validation_status: str or ~data_box_management_client.models.AddressValidationStatus + :ivar alternate_addresses: List of alternate addresses. + :vartype alternate_addresses: list[~data_box_management_client.models.ShippingAddress] + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'validation_status': {'readonly': True}, + 'alternate_addresses': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'validation_status': {'key': 'validationStatus', 'type': 'str'}, + 'alternate_addresses': {'key': 'alternateAddresses', 'type': '[ShippingAddress]'}, + } + + def __init__( + self, + **kwargs + ): + super(AddressValidationProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateAddress' # type: str self.validation_status = None self.alternate_addresses = None -class ApplianceNetworkConfiguration(Model): +class ApiError(msrest.serialization.Model): + """ApiError. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. + :type error: ~data_box_management_client.models.ErrorDetail + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: "ErrorDetail", + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.error = error + + +class ApplianceNetworkConfiguration(msrest.serialization.Model): """The Network Adapter configuration of a DataBox. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the network. :vartype name: str @@ -114,17 +262,19 @@ class ApplianceNetworkConfiguration(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ApplianceNetworkConfiguration, self).__init__(**kwargs) self.name = None self.mac_address = None -class ArmBaseObject(Model): +class ArmBaseObject(msrest.serialization.Model): """Base class for all objects under resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the object. :vartype name: str @@ -146,38 +296,36 @@ class ArmBaseObject(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ArmBaseObject, self).__init__(**kwargs) self.name = None self.id = None self.type = None -class AvailableSkuRequest(Model): +class AvailableSkuRequest(msrest.serialization.Model): """The filters for showing the available skus. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. - :ivar transfer_type: Required. Type of the transfer. Default value: - "ImportToAzure" . - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. - For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType + :param country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. :type country: str - :param location: Required. Location for data transfer. For locations - check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type location: str - :param sku_names: Sku Names to filter for available skus - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + :param sku_names: Sku Names to filter for available skus. + :type sku_names: list[str or ~data_box_management_client.models.SkuName] """ _validation = { - 'transfer_type': {'required': True, 'constant': True}, + 'transfer_type': {'required': True}, 'country': {'required': True}, 'location': {'required': True}, } @@ -186,19 +334,119 @@ class AvailableSkuRequest(Model): 'transfer_type': {'key': 'transferType', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, - 'sku_names': {'key': 'skuNames', 'type': '[SkuName]'}, - } - - transfer_type = "ImportToAzure" - - def __init__(self, *, country: str, location: str, sku_names=None, **kwargs) -> None: + 'sku_names': {'key': 'skuNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + transfer_type: Union[str, "TransferType"], + country: str, + location: str, + sku_names: Optional[List[Union[str, "SkuName"]]] = None, + **kwargs + ): super(AvailableSkuRequest, self).__init__(**kwargs) + self.transfer_type = transfer_type self.country = country self.location = location self.sku_names = sku_names -class CancellationReason(Model): +class AvailableSkusResult(msrest.serialization.Model): + """The available skus operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of available skus. + :vartype value: list[~data_box_management_client.models.SkuInformation] + :param next_link: Link for the next set of skus. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInformation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(AvailableSkusResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class AzureFileFilterDetails(msrest.serialization.Model): + """Filter details to transfer Azure files. + + :param file_prefix_list: Prefix list of the Azure files to be transferred. + :type file_prefix_list: list[str] + :param file_path_list: List of full path of the files to be transferred. + :type file_path_list: list[str] + :param file_share_list: List of file shares to be transferred. + :type file_share_list: list[str] + """ + + _attribute_map = { + 'file_prefix_list': {'key': 'filePrefixList', 'type': '[str]'}, + 'file_path_list': {'key': 'filePathList', 'type': '[str]'}, + 'file_share_list': {'key': 'fileShareList', 'type': '[str]'}, + } + + def __init__( + self, + *, + file_prefix_list: Optional[List[str]] = None, + file_path_list: Optional[List[str]] = None, + file_share_list: Optional[List[str]] = None, + **kwargs + ): + super(AzureFileFilterDetails, self).__init__(**kwargs) + self.file_prefix_list = file_prefix_list + self.file_path_list = file_path_list + self.file_share_list = file_share_list + + +class BlobFilterDetails(msrest.serialization.Model): + """Filter details to transfer Azure Blobs. + + :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :type blob_prefix_list: list[str] + :param blob_path_list: List of full path of the blobs to be transferred. + :type blob_path_list: list[str] + :param container_list: List of blob containers to be transferred. + :type container_list: list[str] + """ + + _attribute_map = { + 'blob_prefix_list': {'key': 'blobPrefixList', 'type': '[str]'}, + 'blob_path_list': {'key': 'blobPathList', 'type': '[str]'}, + 'container_list': {'key': 'containerList', 'type': '[str]'}, + } + + def __init__( + self, + *, + blob_prefix_list: Optional[List[str]] = None, + blob_path_list: Optional[List[str]] = None, + container_list: Optional[List[str]] = None, + **kwargs + ): + super(BlobFilterDetails, self).__init__(**kwargs) + self.blob_prefix_list = blob_prefix_list + self.blob_path_list = blob_path_list + self.container_list = container_list + + +class CancellationReason(msrest.serialization.Model): """Reason for cancellation. All required parameters must be populated in order to send to Azure. @@ -215,30 +463,36 @@ class CancellationReason(Model): 'reason': {'key': 'reason', 'type': 'str'}, } - def __init__(self, *, reason: str, **kwargs) -> None: + def __init__( + self, + *, + reason: str, + **kwargs + ): super(CancellationReason, self).__init__(**kwargs) self.reason = reason -class CloudError(Model): - """The error information object. +class CloudError(msrest.serialization.Model): + """Cloud error. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: Error code string. - :vartype code: str - :ivar message: Descriptive error information. - :vartype message: str - :param target: Error target + :param code: Cloud error code. + :type code: str + :param message: Cloud error message. + :type message: str + :param target: Cloud error target. :type target: str - :param details: More detailed error information. - :type details: list[~azure.mgmt.databox.models.CloudError] + :ivar details: Cloud error details. + :vartype details: list[~data_box_management_client.models.CloudError] + :ivar additional_info: Cloud error additional info. + :vartype additional_info: list[~data_box_management_client.models.AdditionalErrorInfo] """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { @@ -246,29 +500,26 @@ class CloudError(Model): 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'details': {'key': 'details', 'type': '[CloudError]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[AdditionalErrorInfo]'}, } - def __init__(self, *, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + **kwargs + ): super(CloudError, self).__init__(**kwargs) - self.code = None - self.message = None + self.code = code + self.message = message self.target = target - self.details = details - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): + self.details = None + self.additional_info = None - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - -class ContactDetails(Model): +class ContactDetails(msrest.serialization.Model): """Contact Details. All required parameters must be populated in order to send to Azure. @@ -281,12 +532,10 @@ class ContactDetails(Model): :type phone_extension: str :param mobile: Mobile number of the contact person. :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job - progress. + :param email_list: Required. List of Email-ids to be notified about job progress. :type email_list: list[str] :param notification_preference: Notification preference for a job stage. - :type notification_preference: - list[~azure.mgmt.databox.models.NotificationPreference] + :type notification_preference: list[~data_box_management_client.models.NotificationPreference] """ _validation = { @@ -304,7 +553,17 @@ class ContactDetails(Model): 'notification_preference': {'key': 'notificationPreference', 'type': '[NotificationPreference]'}, } - def __init__(self, *, contact_name: str, phone: str, email_list, phone_extension: str=None, mobile: str=None, notification_preference=None, **kwargs) -> None: + def __init__( + self, + *, + contact_name: str, + phone: str, + email_list: List[str], + phone_extension: Optional[str] = None, + mobile: Optional[str] = None, + notification_preference: Optional[List["NotificationPreference"]] = None, + **kwargs + ): super(ContactDetails, self).__init__(**kwargs) self.contact_name = contact_name self.phone = phone @@ -314,17 +573,17 @@ def __init__(self, *, contact_name: str, phone: str, email_list, phone_extension self.notification_preference = notification_preference -class CopyLogDetails(Model): +class CopyLogDetails(msrest.serialization.Model): """Details for log generated during copy. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, - DataBoxHeavyAccountCopyLogDetails + sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator """ _validation = { @@ -339,54 +598,64 @@ class CopyLogDetails(Model): 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = None + self.copy_log_details_type = None # type: Optional[str] -class CopyProgress(Model): +class CopyProgress(msrest.serialization.Model): """Copy progress. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar storage_account_name: Name of the storage account where the data - needs to be uploaded. + :ivar storage_account_name: Name of the storage account. This will be empty for data account + types other than storage account. :vartype storage_account_name: str - :ivar data_destination_type: Data Destination Type. Possible values - include: 'StorageAccount', 'ManagedDisk' - :vartype data_destination_type: str or - ~azure.mgmt.databox.models.DataDestinationType + :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", + "ExportFromAzure". + :vartype transfer_type: str or ~data_box_management_client.models.TransferType + :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", + "ManagedDisk". + :vartype data_account_type: str or ~data_box_management_client.models.DataAccountType :ivar account_id: Id of the account where the data needs to be uploaded. :vartype account_id: str - :ivar bytes_sent_to_cloud: Amount of data uploaded by the job as of now. - :vartype bytes_sent_to_cloud: long - :ivar total_bytes_to_process: Total amount of data to be processed by the - job. + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: long + :ivar total_bytes_to_process: Total amount of data to be processed by the job. :vartype total_bytes_to_process: long - :ivar files_processed: Number of files processed by the job as of now. + :ivar files_processed: Number of files processed. :vartype files_processed: long - :ivar total_files_to_process: Total number of files to be processed by the - job. + :ivar total_files_to_process: Total files to process. :vartype total_files_to_process: long - :ivar invalid_files_processed: Number of files not adhering to azure - naming conventions which were processed by automatic renaming + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. :vartype invalid_files_processed: long - :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to - azure naming conventions which were processed by automatic renaming + :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to azure naming + conventions which were processed by automatic renaming. :vartype invalid_file_bytes_uploaded: long - :ivar renamed_container_count: Number of folders not adhering to azure - naming conventions which were processed by automatic renaming + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. :vartype renamed_container_count: long - :ivar files_errored_out: Number of files which could not be copied + :ivar files_errored_out: Number of files which could not be copied. :vartype files_errored_out: long + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: long + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: long + :ivar is_enumeration_in_progress: To indicate if enumeration of data is in progress. + Until this is true, the TotalBytesToProcess may not be valid. + :vartype is_enumeration_in_progress: bool """ _validation = { 'storage_account_name': {'readonly': True}, - 'data_destination_type': {'readonly': True}, + 'transfer_type': {'readonly': True}, + 'data_account_type': {'readonly': True}, 'account_id': {'readonly': True}, - 'bytes_sent_to_cloud': {'readonly': True}, + 'bytes_processed': {'readonly': True}, 'total_bytes_to_process': {'readonly': True}, 'files_processed': {'readonly': True}, 'total_files_to_process': {'readonly': True}, @@ -394,13 +663,17 @@ class CopyProgress(Model): 'invalid_file_bytes_uploaded': {'readonly': True}, 'renamed_container_count': {'readonly': True}, 'files_errored_out': {'readonly': True}, + 'directories_errored_out': {'readonly': True}, + 'invalid_directories_processed': {'readonly': True}, + 'is_enumeration_in_progress': {'readonly': True}, } _attribute_map = { 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'DataDestinationType'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, 'account_id': {'key': 'accountId', 'type': 'str'}, - 'bytes_sent_to_cloud': {'key': 'bytesSentToCloud', 'type': 'long'}, + 'bytes_processed': {'key': 'bytesProcessed', 'type': 'long'}, 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, @@ -408,14 +681,21 @@ class CopyProgress(Model): 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, + 'directories_errored_out': {'key': 'directoriesErroredOut', 'type': 'long'}, + 'invalid_directories_processed': {'key': 'invalidDirectoriesProcessed', 'type': 'long'}, + 'is_enumeration_in_progress': {'key': 'isEnumerationInProgress', 'type': 'bool'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CopyProgress, self).__init__(**kwargs) self.storage_account_name = None - self.data_destination_type = None + self.transfer_type = None + self.data_account_type = None self.account_id = None - self.bytes_sent_to_cloud = None + self.bytes_processed = None self.total_bytes_to_process = None self.files_processed = None self.total_files_to_process = None @@ -423,42 +703,51 @@ def __init__(self, **kwargs) -> None: self.invalid_file_bytes_uploaded = None self.renamed_container_count = None self.files_errored_out = None + self.directories_errored_out = None + self.invalid_directories_processed = None + self.is_enumeration_in_progress = None -class ValidationRequest(Model): - """Input request for all pre job creation validation. +class ValidationRequest(msrest.serialization.Model): + """Minimum request requirement of any validation category. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CreateJobValidations + sub-classes are: CreateJobValidations. All required parameters must be populated in order to send to Azure. - :param individual_request_details: Required. List of request details - contain validationType and its request as key and value respectively. - :type individual_request_details: - list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Constant filled by server. + :param validation_category: Required. Identify the nature of validation.Constant filled by + server. :type validation_category: str + :param individual_request_details: Required. List of request details contain validationType and + its request as key and value respectively. + :type individual_request_details: + list[~data_box_management_client.models.ValidationInputRequest] """ _validation = { - 'individual_request_details': {'required': True}, 'validation_category': {'required': True}, + 'individual_request_details': {'required': True}, } _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, } _subtype_map = { 'validation_category': {'JobCreationValidation': 'CreateJobValidations'} } - def __init__(self, *, individual_request_details, **kwargs) -> None: + def __init__( + self, + *, + individual_request_details: List["ValidationInputRequest"], + **kwargs + ): super(ValidationRequest, self).__init__(**kwargs) + self.validation_category = None # type: Optional[str] self.individual_request_details = individual_request_details - self.validation_category = None class CreateJobValidations(ValidationRequest): @@ -466,42 +755,48 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param individual_request_details: Required. List of request details - contain validationType and its request as key and value respectively. - :type individual_request_details: - list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Constant filled by server. + :param validation_category: Required. Identify the nature of validation.Constant filled by + server. :type validation_category: str + :param individual_request_details: Required. List of request details contain validationType and + its request as key and value respectively. + :type individual_request_details: + list[~data_box_management_client.models.ValidationInputRequest] """ _validation = { - 'individual_request_details': {'required': True}, 'validation_category': {'required': True}, + 'individual_request_details': {'required': True}, } _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, } - def __init__(self, *, individual_request_details, **kwargs) -> None: + def __init__( + self, + *, + individual_request_details: List["ValidationInputRequest"], + **kwargs + ): super(CreateJobValidations, self).__init__(individual_request_details=individual_request_details, **kwargs) - self.validation_category = 'JobCreationValidation' + self.validation_category = 'JobCreationValidation' # type: str -class ValidationInputRequest(Model): +class ValidationInputRequest(msrest.serialization.Model): """Minimum fields that must be present in any type of validation request. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CreateOrderLimitForSubscriptionValidationRequest, - DataDestinationDetailsValidationRequest, PreferencesValidationRequest, - SkuAvailabilityValidationRequest, - SubscriptionIsAllowedToCreateJobValidationRequest, ValidateAddress + sub-classes are: ValidateAddress, CreateOrderLimitForSubscriptionValidationRequest, DataTransferDetailsValidationRequest, PreferencesValidationRequest, SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator """ _validation = { @@ -513,12 +808,15 @@ class ValidationInputRequest(Model): } _subtype_map = { - 'validation_type': {'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataDestinationDetails': 'DataDestinationDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest', 'ValidateAddress': 'ValidateAddress'} + 'validation_type': {'ValidateAddress': 'ValidateAddress', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest'} } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ValidationInputRequest, self).__init__(**kwargs) - self.validation_type = None + self.validation_type = None # type: Optional[str] class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): @@ -526,11 +824,14 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName """ _validation = { @@ -540,138 +841,158 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, } - def __init__(self, *, device_type, **kwargs) -> None: + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + **kwargs + ): super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateCreateOrderLimit' # type: str self.device_type = device_type - self.validation_type = 'ValidateCreateOrderLimit' -class ValidationInputResponse(Model): - """Minimum properties that should be present in each individual validation - response. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: - CreateOrderLimitForSubscriptionValidationResponseProperties, - DataDestinationDetailsValidationResponseProperties, - PreferencesValidationResponseProperties, - SkuAvailabilityValidationResponseProperties, - SubscriptionIsAllowedToCreateJobValidationResponseProperties +class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): + """Properties of create order limit for subscription validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Create order limit validation status. Possible values include: "Valid", + "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - _subtype_map = { - 'validation_type': {'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataDestinationDetails': 'DataDestinationDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} - } - - def __init__(self, **kwargs) -> None: - super(ValidationInputResponse, self).__init__(**kwargs) - self.error = None - self.validation_type = None + def __init__( + self, + **kwargs + ): + super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateCreateOrderLimit' # type: str + self.status = None -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. +class DataAccountDetails(msrest.serialization.Model): + """Account details of the data to be transferred. - Variables are only populated by the server, and will be ignored when - sending a request. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ManagedDiskDetails, StorageAccountDetails. All required parameters must be populated in order to send to Azure. - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Create order limit validation status. Possible values - include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str """ _validation = { - 'error': {'readonly': True}, - 'validation_type': {'required': True}, - 'status': {'readonly': True}, + 'data_account_type': {'required': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) - self.status = None - self.validation_type = 'ValidateCreateOrderLimit' + _subtype_map = { + 'data_account_type': {'ManagedDisk': 'ManagedDiskDetails', 'StorageAccount': 'StorageAccountDetails'} + } + + def __init__( + self, + *, + share_password: Optional[str] = None, + **kwargs + ): + super(DataAccountDetails, self).__init__(**kwargs) + self.data_account_type = None # type: Optional[str] + self.share_password = share_password class DataBoxAccountCopyLogDetails(CopyLogDetails): """Copy log details for a storage account of a DataBox job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str - :ivar account_name: Destination account name. + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. :vartype copy_log_link: str + :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when + LogCollectionLevel is set to Verbose. + :vartype copy_verbose_log_link: str """ _validation = { 'copy_log_details_type': {'required': True}, 'account_name': {'readonly': True}, 'copy_log_link': {'readonly': True}, + 'copy_verbose_log_link': {'readonly': True}, } _attribute_map = { 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, 'account_name': {'key': 'accountName', 'type': 'str'}, 'copy_log_link': {'key': 'copyLogLink', 'type': 'str'}, + 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBox' # type: str self.account_name = None self.copy_log_link = None - self.copy_log_details_type = 'DataBox' + self.copy_verbose_log_link = None class DataBoxDiskCopyLogDetails(CopyLogDetails): """Copy Log Details for a disk. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator :ivar disk_serial_number: Disk Serial Number. :vartype disk_serial_number: str :ivar error_log_link: Link for copy error logs. @@ -694,32 +1015,32 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): 'verbose_log_link': {'key': 'verboseLogLink', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBoxDisk' # type: str self.disk_serial_number = None self.error_log_link = None self.verbose_log_link = None - self.copy_log_details_type = 'DataBoxDisk' -class DataBoxDiskCopyProgress(Model): +class DataBoxDiskCopyProgress(msrest.serialization.Model): """DataBox Disk Copy Progress. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar serial_number: The serial number of the disk + :ivar serial_number: The serial number of the disk. :vartype serial_number: str :ivar bytes_copied: Bytes copied during the copy of disk. :vartype bytes_copied: long - :ivar percent_complete: Indicates the percentage completed for the copy of - the disk. + :ivar percent_complete: Indicates the percentage completed for the copy of the disk. :vartype percent_complete: int - :ivar status: The Status of the copy. Possible values include: - 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', - 'NotReturned', 'HardwareError', 'DeviceFormatted', - 'DeviceMetadataModified', 'StorageAccountNotAccessible', 'UnsupportedData' - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". + :vartype status: str or ~data_box_management_client.models.CopyStatus """ _validation = { @@ -733,10 +1054,13 @@ class DataBoxDiskCopyProgress(Model): 'serial_number': {'key': 'serialNumber', 'type': 'str'}, 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'CopyStatus'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxDiskCopyProgress, self).__init__(**kwargs) self.serial_number = None self.bytes_copied = None @@ -744,153 +1068,154 @@ def __init__(self, **kwargs) -> None: self.status = None -class JobDetails(Model): +class JobDetails(msrest.serialization.Model): """Job details. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxDiskJobDetails, DataBoxHeavyJobDetails, - DataBoxJobDetails + sub-classes are: DataBoxJobDetails, DataBoxDiskJobDetails, DataBoxHeavyJobDetails. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, + 'key_encryption_key': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, } _subtype_map = { - 'job_details_type': {'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails', 'DataBox': 'DataBoxJobDetails'} - } - - def __init__(self, *, contact_details, shipping_address, destination_account_details, expected_data_size_in_terabytes: int=None, preferences=None, **kwargs) -> None: + 'job_details_type': {'DataBox': 'DataBoxJobDetails', 'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails'} + } + + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + expected_data_size_in_terabytes: Optional[int] = None, + **kwargs + ): super(JobDetails, self).__init__(**kwargs) - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes self.job_stages = None self.contact_details = contact_details self.shipping_address = shipping_address self.delivery_package = None self.return_package = None - self.destination_account_details = destination_account_details - self.error_details = None + self.data_import_details = data_import_details + self.data_export_details = data_export_details + self.job_details_type = None # type: Optional[str] self.preferences = preferences self.copy_log_details = None self.reverse_shipment_label_sas_key = None self.chain_of_custody_sas_key = None - self.job_details_type = None + self.key_encryption_key = None + self.expected_data_size_in_terabytes = expected_data_size_in_terabytes class DataBoxDiskJobDetails(JobDetails): """DataBox Disk Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str - :param preferred_disks: User preference on what size disks are needed for - the job. The map is from the disk size in TB to the count. Eg. {2,5} means - 5 disks of 2 TB size. Key is string but will be checked against an int. + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int + :param preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. :type preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: - list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to - the disk size being used for the job. Is returned only after the disks are - shipped to the customer. + :vartype copy_progress: list[~data_box_management_client.models.DataBoxDiskCopyProgress] + :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being + used for the job. Is returned only after the disks are shipped to the customer. :vartype disks_and_size_details: dict[str, int] :param passkey: User entered passkey for DataBox Disk job. :type passkey: str @@ -899,100 +1224,120 @@ class DataBoxDiskJobDetails(JobDetails): _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, + 'key_encryption_key': {'readonly': True}, 'copy_progress': {'readonly': True}, 'disks_and_size_details': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, 'passkey': {'key': 'passkey', 'type': 'str'}, } - def __init__(self, *, contact_details, shipping_address, destination_account_details, expected_data_size_in_terabytes: int=None, preferences=None, preferred_disks=None, passkey: str=None, **kwargs) -> None: - super(DataBoxDiskJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + expected_data_size_in_terabytes: Optional[int] = None, + preferred_disks: Optional[Dict[str, int]] = None, + passkey: Optional[str] = None, + **kwargs + ): + super(DataBoxDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + self.job_details_type = 'DataBoxDisk' # type: str self.preferred_disks = preferred_disks self.copy_progress = None self.disks_and_size_details = None self.passkey = passkey - self.job_details_type = 'DataBoxDisk' -class JobSecrets(Model): +class JobSecrets(msrest.serialization.Model): """The base class for the secrets. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets, - DataboxJobSecrets + sub-classes are: DataboxJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, } _subtype_map = { - 'job_secrets_type': {'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets', 'DataBox': 'DataboxJobSecrets'} + 'job_secrets_type': {'DataBox': 'DataboxJobSecrets', 'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets'} } - def __init__(self, *, dc_access_security_code=None, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(JobSecrets, self).__init__(**kwargs) - self.dc_access_security_code = dc_access_security_code - self.job_secrets_type = None + self.job_secrets_type = None # type: Optional[str] + self.dc_access_security_code = None + self.error = None class DataBoxDiskJobSecrets(JobSecrets): """The secrets related to disk job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] + :vartype disk_secrets: list[~data_box_management_client.models.DiskSecret] :ivar pass_key: PassKey for the disk Job. :vartype pass_key: str :ivar is_passkey_user_defined: Whether passkey was provided by user. @@ -1001,190 +1346,220 @@ class DataBoxDiskJobSecrets(JobSecrets): _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, 'disk_secrets': {'readonly': True}, 'pass_key': {'readonly': True}, 'is_passkey_user_defined': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'disk_secrets': {'key': 'diskSecrets', 'type': '[DiskSecret]'}, 'pass_key': {'key': 'passKey', 'type': 'str'}, 'is_passkey_user_defined': {'key': 'isPasskeyUserDefined', 'type': 'bool'}, } - def __init__(self, *, dc_access_security_code=None, **kwargs) -> None: - super(DataBoxDiskJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) + def __init__( + self, + **kwargs + ): + super(DataBoxDiskJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBoxDisk' # type: str self.disk_secrets = None self.pass_key = None self.is_passkey_user_defined = None - self.job_secrets_type = 'DataBoxDisk' class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): """Copy log details for a storage account for Databox heavy. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Constant filled by server. - :type copy_log_details_type: str - :ivar account_name: Destination account name. + :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type copy_log_details_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. :vartype copy_log_link: list[str] + :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when the + LogCollectionLevel is set to verbose. + :vartype copy_verbose_log_link: list[str] """ _validation = { 'copy_log_details_type': {'required': True}, 'account_name': {'readonly': True}, 'copy_log_link': {'readonly': True}, + 'copy_verbose_log_link': {'readonly': True}, } _attribute_map = { 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, 'account_name': {'key': 'accountName', 'type': 'str'}, 'copy_log_link': {'key': 'copyLogLink', 'type': '[str]'}, + 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': '[str]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBoxHeavy' # type: str self.account_name = None self.copy_log_link = None - self.copy_log_details_type = 'DataBoxHeavy' + self.copy_verbose_log_link = None class DataBoxHeavyJobDetails(JobDetails): """Databox Heavy Device Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy + :vartype copy_progress: list[~data_box_management_client.models.CopyProgress] + :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed + for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. :type device_password: str """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, + 'key_encryption_key': {'readonly': True}, 'copy_progress': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } - def __init__(self, *, contact_details, shipping_address, destination_account_details, expected_data_size_in_terabytes: int=None, preferences=None, device_password: str=None, **kwargs) -> None: - super(DataBoxHeavyJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + expected_data_size_in_terabytes: Optional[int] = None, + device_password: Optional[str] = None, + **kwargs + ): + super(DataBoxHeavyJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + self.job_details_type = 'DataBoxHeavy' # type: str self.copy_progress = None self.device_password = device_password - self.job_details_type = 'DataBoxHeavy' class DataBoxHeavyJobSecrets(JobSecrets): """The secrets related to a databox heavy job. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str - :ivar cabinet_pod_secrets: Contains the list of secret objects for a - databox heavy job. - :vartype cabinet_pod_secrets: - list[~azure.mgmt.databox.models.DataBoxHeavySecret] + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError + :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. + :vartype cabinet_pod_secrets: list[~data_box_management_client.models.DataBoxHeavySecret] """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, 'cabinet_pod_secrets': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'cabinet_pod_secrets': {'key': 'cabinetPodSecrets', 'type': '[DataBoxHeavySecret]'}, } - def __init__(self, *, dc_access_security_code=None, **kwargs) -> None: - super(DataBoxHeavyJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) + def __init__( + self, + **kwargs + ): + super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBoxHeavy' # type: str self.cabinet_pod_secrets = None - self.job_secrets_type = 'DataBoxHeavy' -class DataBoxHeavySecret(Model): +class DataBoxHeavySecret(msrest.serialization.Model): """The secrets related to a databox heavy. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar device_serial_number: Serial number of the assigned device. :vartype device_serial_number: str @@ -1192,13 +1567,13 @@ class DataBoxHeavySecret(Model): :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. :vartype network_configurations: - list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to - authenticate with the device + list[~data_box_management_client.models.ApplianceNetworkConfiguration] + :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the + device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. :vartype account_credential_details: - list[~azure.mgmt.databox.models.AccountCredentialDetails] + list[~data_box_management_client.models.AccountCredentialDetails] """ _validation = { @@ -1217,7 +1592,10 @@ class DataBoxHeavySecret(Model): 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxHeavySecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1229,135 +1607,159 @@ def __init__(self, **kwargs) -> None: class DataBoxJobDetails(JobDetails): """Databox Job Details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, - which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and - shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~data_box_management_client.models.JobStages] + :param contact_details: Required. Contact details for notification and shipping. + :type contact_details: ~data_box_management_client.models.ContactDetails + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~data_box_management_client.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype return_package: ~data_box_management_client.models.PackageShippingDetails + :param data_import_details: Details of the data to be imported into azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param data_export_details: Details of the data to be exported from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_details_type: str or ~data_box_management_client.models.ClassDiscriminator :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :type preferences: ~data_box_management_client.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the - return shipment label + :vartype copy_log_details: list[~data_box_management_client.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of - custody logs + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param job_details_type: Required. Constant filled by server. - :type job_details_type: str + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~data_box_management_client.models.KeyEncryptionKey + :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :type expected_data_size_in_terabytes: int :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox + :vartype copy_progress: list[~data_box_management_client.models.CopyProgress] + :param device_password: Set Device password for unlocking Databox. Should not be passed for + TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password + itself. This will not be returned in Get Call. Password Requirements : Password must be + minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, + one number and one special character. Password cannot have the following characters : IilLoO0 + Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. :type device_password: str """ _validation = { 'job_stages': {'readonly': True}, 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, 'delivery_package': {'readonly': True}, 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, + 'job_details_type': {'required': True}, 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'job_details_type': {'required': True}, + 'key_encryption_key': {'readonly': True}, 'copy_progress': {'readonly': True}, } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'Preferences'}, 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } - def __init__(self, *, contact_details, shipping_address, destination_account_details, expected_data_size_in_terabytes: int=None, preferences=None, device_password: str=None, **kwargs) -> None: - super(DataBoxJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + expected_data_size_in_terabytes: Optional[int] = None, + device_password: Optional[str] = None, + **kwargs + ): + super(DataBoxJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + self.job_details_type = 'DataBox' # type: str self.copy_progress = None self.device_password = device_password - self.job_details_type = 'DataBox' class DataboxJobSecrets(JobSecrets): """The secrets related to a databox job. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :param dc_access_security_code: Dc Access Security Code for Customer - Managed Shipping - :type dc_access_security_code: - ~azure.mgmt.databox.models.DcAccessSecurityCode - :param job_secrets_type: Required. Constant filled by server. - :type job_secrets_type: str + :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type job_secrets_type: str or ~data_box_management_client.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~data_box_management_client.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~data_box_management_client.models.CloudError :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :type pod_secrets: list[~data_box_management_client.models.DataBoxSecret] """ _validation = { 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, } - def __init__(self, *, dc_access_security_code=None, pod_secrets=None, **kwargs) -> None: - super(DataboxJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) + def __init__( + self, + *, + pod_secrets: Optional[List["DataBoxSecret"]] = None, + **kwargs + ): + super(DataboxJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBox' # type: str self.pod_secrets = pod_secrets - self.job_secrets_type = 'DataBox' -class ScheduleAvailabilityRequest(Model): +class ScheduleAvailabilityRequest(msrest.serialization.Model): """Request body to get the availability for scheduling orders. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxScheduleAvailabilityRequest, - DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest + sub-classes are: DataBoxScheduleAvailabilityRequest, DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest. All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { @@ -1368,16 +1770,24 @@ class ScheduleAvailabilityRequest(Model): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } _subtype_map = { 'sku_name': {'DataBox': 'DataBoxScheduleAvailabilityRequest', 'DataBoxDisk': 'DiskScheduleAvailabilityRequest', 'DataBoxHeavy': 'HeavyScheduleAvailabilityRequest'} } - def __init__(self, *, storage_location: str, **kwargs) -> None: + def __init__( + self, + *, + storage_location: str, + country: Optional[str] = None, + **kwargs + ): super(ScheduleAvailabilityRequest, self).__init__(**kwargs) self.storage_location = storage_location - self.sku_name = None + self.sku_name = None # type: Optional[str] + self.country = country class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1385,12 +1795,14 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { @@ -1401,18 +1813,24 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } - def __init__(self, *, storage_location: str, **kwargs) -> None: - super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) - self.sku_name = 'DataBox' + def __init__( + self, + *, + storage_location: str, + country: Optional[str] = None, + **kwargs + ): + super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) + self.sku_name = 'DataBox' # type: str -class DataBoxSecret(Model): +class DataBoxSecret(msrest.serialization.Model): """The secrets related to a DataBox. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar device_serial_number: Serial number of the assigned device. :vartype device_serial_number: str @@ -1420,13 +1838,13 @@ class DataBoxSecret(Model): :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. :vartype network_configurations: - list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to - authenticate with the device + list[~data_box_management_client.models.ApplianceNetworkConfiguration] + :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the + device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. :vartype account_credential_details: - list[~azure.mgmt.databox.models.AccountCredentialDetails] + list[~data_box_management_client.models.AccountCredentialDetails] """ _validation = { @@ -1445,7 +1863,10 @@ class DataBoxSecret(Model): 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DataBoxSecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1454,235 +1875,252 @@ def __init__(self, **kwargs) -> None: self.account_credential_details = None -class DataDestinationDetailsValidationRequest(ValidationInputRequest): - """Request to validate data destination details. +class DataExportDetails(msrest.serialization.Model): + """Details of the data to be used for exporting data from azure. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param destination_account_details: Required. Destination account details - list. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param location: Required. Location of stamp or geo. - :type location: str + :param transfer_configuration: Required. Configuration for the data transfer. + :type transfer_configuration: ~data_box_management_client.models.TransferConfiguration + :param log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". + :type log_collection_level: str or ~data_box_management_client.models.LogCollectionLevel + :param account_details: Required. Account details of the data to be transferred. + :type account_details: ~data_box_management_client.models.DataAccountDetails """ _validation = { - 'validation_type': {'required': True}, - 'destination_account_details': {'required': True}, - 'location': {'required': True}, + 'transfer_configuration': {'required': True}, + 'account_details': {'required': True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, + 'transfer_configuration': {'key': 'transferConfiguration', 'type': 'TransferConfiguration'}, + 'log_collection_level': {'key': 'logCollectionLevel', 'type': 'str'}, + 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, } - def __init__(self, *, destination_account_details, location: str, **kwargs) -> None: - super(DataDestinationDetailsValidationRequest, self).__init__(**kwargs) - self.destination_account_details = destination_account_details - self.location = location - self.validation_type = 'ValidateDataDestinationDetails' - + def __init__( + self, + *, + transfer_configuration: "TransferConfiguration", + account_details: "DataAccountDetails", + log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = None, + **kwargs + ): + super(DataExportDetails, self).__init__(**kwargs) + self.transfer_configuration = transfer_configuration + self.log_collection_level = log_collection_level + self.account_details = account_details -class DataDestinationDetailsValidationResponseProperties(ValidationInputResponse): - """Properties of data destination details validation response. - Variables are only populated by the server, and will be ignored when - sending a request. +class DataImportDetails(msrest.serialization.Model): + """Details of the data to be used for importing data to azure. All required parameters must be populated in order to send to Azure. - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Data destination details validation status. Possible values - include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :param account_details: Required. Account details of the data to be transferred. + :type account_details: ~data_box_management_client.models.DataAccountDetails """ _validation = { - 'error': {'readonly': True}, - 'validation_type': {'required': True}, - 'status': {'readonly': True}, + 'account_details': {'required': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, } - def __init__(self, **kwargs) -> None: - super(DataDestinationDetailsValidationResponseProperties, self).__init__(**kwargs) - self.status = None - self.validation_type = 'ValidateDataDestinationDetails' + def __init__( + self, + *, + account_details: "DataAccountDetails", + **kwargs + ): + super(DataImportDetails, self).__init__(**kwargs) + self.account_details = account_details -class DcAccessSecurityCode(Model): - """Dc Access Security code for device. +class DataLocationToServiceLocationMap(msrest.serialization.Model): + """Map of data location to service location. - :param forward_dc_access_code: Dc Access Code for dispatching from DC. - :type forward_dc_access_code: str - :param reverse_dc_access_code: Dc Access code for dropping off at DC. - :type reverse_dc_access_code: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar data_location: Location of the data. + :vartype data_location: str + :ivar service_location: Location of the service. + :vartype service_location: str """ - _attribute_map = { - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, + _validation = { + 'data_location': {'readonly': True}, + 'service_location': {'readonly': True}, } - def __init__(self, *, forward_dc_access_code: str=None, reverse_dc_access_code: str=None, **kwargs) -> None: - super(DcAccessSecurityCode, self).__init__(**kwargs) - self.forward_dc_access_code = forward_dc_access_code - self.reverse_dc_access_code = reverse_dc_access_code + _attribute_map = { + 'data_location': {'key': 'dataLocation', 'type': 'str'}, + 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + } + def __init__( + self, + **kwargs + ): + super(DataLocationToServiceLocationMap, self).__init__(**kwargs) + self.data_location = None + self.service_location = None -class DestinationAccountDetails(Model): - """Details of the destination storage accounts. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DestinationManagedDiskDetails, - DestinationStorageAccountDetails +class DataTransferDetailsValidationRequest(ValidationInputRequest): + """Request to validate export and import data details. All required parameters must be populated in order to send to Azure. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param data_export_details: List of DataTransfer details to be used to export data from azure. + :type data_export_details: list[~data_box_management_client.models.DataExportDetails] + :param data_import_details: List of DataTransfer details to be used to import data to azure. + :type data_import_details: list[~data_box_management_client.models.DataImportDetails] + :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType """ _validation = { - 'data_destination_type': {'required': True}, + 'validation_type': {'required': True}, + 'device_type': {'required': True}, + 'transfer_type': {'required': True}, } _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, } - _subtype_map = { - 'data_destination_type': {'ManagedDisk': 'DestinationManagedDiskDetails', 'StorageAccount': 'DestinationStorageAccountDetails'} - } + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + transfer_type: Union[str, "TransferType"], + data_export_details: Optional[List["DataExportDetails"]] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + **kwargs + ): + super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateDataTransferDetails' # type: str + self.data_export_details = data_export_details + self.data_import_details = data_import_details + self.device_type = device_type + self.transfer_type = transfer_type - def __init__(self, *, account_id: str=None, share_password: str=None, **kwargs) -> None: - super(DestinationAccountDetails, self).__init__(**kwargs) - self.account_id = account_id - self.share_password = share_password - self.data_destination_type = None +class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): + """Properties of data transfer details validation response. -class DestinationManagedDiskDetails(DestinationAccountDetails): - """Details for the destination compute disks. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str - :param resource_group_id: Required. Destination Resource Group Id where - the Compute disks should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account - that can be used to copy the vhd for staging. - :type staging_storage_account_id: str + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Data transfer details validation status. Possible values include: "Valid", + "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'data_destination_type': {'required': True}, - 'resource_group_id': {'required': True}, - 'staging_storage_account_id': {'required': True}, + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, - 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, *, resource_group_id: str, staging_storage_account_id: str, account_id: str=None, share_password: str=None, **kwargs) -> None: - super(DestinationManagedDiskDetails, self).__init__(account_id=account_id, share_password=share_password, **kwargs) - self.resource_group_id = resource_group_id - self.staging_storage_account_id = staging_storage_account_id - self.data_destination_type = 'ManagedDisk' - + def __init__( + self, + **kwargs + ): + super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateDataTransferDetails' # type: str + self.status = None -class DestinationStorageAccountDetails(DestinationAccountDetails): - """Details for the destination storage account. - All required parameters must be populated in order to send to Azure. +class DcAccessSecurityCode(msrest.serialization.Model): + """Dc access security code. - :param account_id: Arm Id of the destination where the data has to be - moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param data_destination_type: Required. Constant filled by server. - :type data_destination_type: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type storage_account_id: str + :param reverse_dc_access_code: Reverse Dc access security code. + :type reverse_dc_access_code: str + :param forward_dc_access_code: Forward Dc access security code. + :type forward_dc_access_code: str """ - _validation = { - 'data_destination_type': {'required': True}, - 'storage_account_id': {'required': True}, - } - _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, + 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, } - def __init__(self, *, storage_account_id: str, account_id: str=None, share_password: str=None, **kwargs) -> None: - super(DestinationStorageAccountDetails, self).__init__(account_id=account_id, share_password=share_password, **kwargs) - self.storage_account_id = storage_account_id - self.data_destination_type = 'StorageAccount' + def __init__( + self, + *, + reverse_dc_access_code: Optional[str] = None, + forward_dc_access_code: Optional[str] = None, + **kwargs + ): + super(DcAccessSecurityCode, self).__init__(**kwargs) + self.reverse_dc_access_code = reverse_dc_access_code + self.forward_dc_access_code = forward_dc_access_code -class DestinationToServiceLocationMap(Model): - """Map of destination location to service location. +class Details(msrest.serialization.Model): + """Details. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar destination_location: Location of the destination. - :vartype destination_location: str - :ivar service_location: Location of the service. - :vartype service_location: str + :param code: Required. + :type code: str + :param message: Required. + :type message: str """ _validation = { - 'destination_location': {'readonly': True}, - 'service_location': {'readonly': True}, + 'code': {'required': True}, + 'message': {'required': True}, } _attribute_map = { - 'destination_location': {'key': 'destinationLocation', 'type': 'str'}, - 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(DestinationToServiceLocationMap, self).__init__(**kwargs) - self.destination_location = None - self.service_location = None + def __init__( + self, + *, + code: str, + message: str, + **kwargs + ): + super(Details, self).__init__(**kwargs) + self.code = code + self.message = message class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1690,14 +2128,16 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str - :param expected_data_size_in_terabytes: Required. The expected size of the - data, which needs to be transferred in this job, in terabytes. + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str + :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to + be transferred in this job, in terabytes. :type expected_data_size_in_terabytes: int """ @@ -1710,25 +2150,32 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, } - def __init__(self, *, storage_location: str, expected_data_size_in_terabytes: int, **kwargs) -> None: - super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) + def __init__( + self, + *, + storage_location: str, + expected_data_size_in_terabytes: int, + country: Optional[str] = None, + **kwargs + ): + super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) + self.sku_name = 'DataBoxDisk' # type: str self.expected_data_size_in_terabytes = expected_data_size_in_terabytes - self.sku_name = 'DataBoxDisk' -class DiskSecret(Model): +class DiskSecret(msrest.serialization.Model): """Contains all the secrets of a Disk. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar disk_serial_number: Serial number of the assigned disk. :vartype disk_serial_number: str - :ivar bit_locker_key: Bit Locker key of the disk which can be used to - unlock the disk to copy data. + :ivar bit_locker_key: Bit Locker key of the disk which can be used to unlock the disk to copy + data. :vartype bit_locker_key: str """ @@ -1742,327 +2189,515 @@ class DiskSecret(Model): 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(DiskSecret, self).__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None -class Error(Model): - """Top level error for the job. - - Variables are only populated by the server, and will be ignored when - sending a request. +class EncryptionPreferences(msrest.serialization.Model): + """Preferences related to the Encryption. - :ivar code: Error code that can be used to programmatically identify the - error. - :vartype code: str - :ivar message: Describes the error in detail and provides debugging - information. - :vartype message: str + :param double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". + :type double_encryption: str or ~data_box_management_client.models.DoubleEncryption """ - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'double_encryption': {'key': 'doubleEncryption', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(Error, self).__init__(**kwargs) - self.code = None - self.message = None + def __init__( + self, + *, + double_encryption: Optional[Union[str, "DoubleEncryption"]] = None, + **kwargs + ): + super(EncryptionPreferences, self).__init__(**kwargs) + self.double_encryption = double_encryption -class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling heavy orders. +class ErrorDetail(msrest.serialization.Model): + """ErrorDetail. All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 - :type storage_location: str - :param sku_name: Required. Constant filled by server. - :type sku_name: str + :param code: Required. + :type code: str + :param message: Required. + :type message: str + :param details: + :type details: list[~data_box_management_client.models.Details] + :param target: + :type target: str """ _validation = { - 'storage_location': {'required': True}, - 'sku_name': {'required': True}, + 'code': {'required': True}, + 'message': {'required': True}, } _attribute_map = { - 'storage_location': {'key': 'storageLocation', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Details]'}, + 'target': {'key': 'target', 'type': 'str'}, } - def __init__(self, *, storage_location: str, **kwargs) -> None: - super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) - self.sku_name = 'DataBoxHeavy' + def __init__( + self, + *, + code: str, + message: str, + details: Optional[List["Details"]] = None, + target: Optional[str] = None, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + self.target = target -class JobDeliveryInfo(Model): - """Additional delivery info. +class FilterFileDetails(msrest.serialization.Model): + """Details of the filter files to be used for data transfer. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: datetime + All required parameters must be populated in order to send to Azure. + + :param filter_file_type: Required. Type of the filter file. Possible values include: + "AzureBlob", "AzureFile". + :type filter_file_type: str or ~data_box_management_client.models.FilterFileType + :param filter_file_path: Required. Path of the file that contains the details of all items to + transfer. + :type filter_file_path: str """ + _validation = { + 'filter_file_type': {'required': True}, + 'filter_file_path': {'required': True}, + } + _attribute_map = { - 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, + 'filter_file_type': {'key': 'filterFileType', 'type': 'str'}, + 'filter_file_path': {'key': 'filterFilePath', 'type': 'str'}, } - def __init__(self, *, scheduled_date_time=None, **kwargs) -> None: - super(JobDeliveryInfo, self).__init__(**kwargs) - self.scheduled_date_time = scheduled_date_time + def __init__( + self, + *, + filter_file_type: Union[str, "FilterFileType"], + filter_file_path: str, + **kwargs + ): + super(FilterFileDetails, self).__init__(**kwargs) + self.filter_file_type = filter_file_type + self.filter_file_path = filter_file_path -class JobErrorDetails(Model): - """Job Error Details for providing the information and recommended action. +class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): + """Request body to get the availability for scheduling heavy orders. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar error_message: Message for the error. - :vartype error_message: str - :ivar error_code: Code for the error. - :vartype error_code: int - :ivar recommended_action: Recommended action for the error. - :vartype recommended_action: str - :ivar exception_message: Contains the non localized exception message - :vartype exception_message: str + :param storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :type storage_location: str + :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName + :param country: Country in which storage location should be supported. + :type country: str """ _validation = { - 'error_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'recommended_action': {'readonly': True}, - 'exception_message': {'readonly': True}, + 'storage_location': {'required': True}, + 'sku_name': {'required': True}, } _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'exception_message': {'key': 'exceptionMessage', 'type': 'str'}, + 'storage_location': {'key': 'storageLocation', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(JobErrorDetails, self).__init__(**kwargs) - self.error_message = None - self.error_code = None - self.recommended_action = None - self.exception_message = None + def __init__( + self, + *, + storage_location: str, + country: Optional[str] = None, + **kwargs + ): + super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) + self.sku_name = 'DataBoxHeavy' # type: str -class Resource(Model): +class Resource(msrest.serialization.Model): """Model of the Resource. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one - of the supported and registered Azure Regions (e.g. West US, East US, - Southeast Asia, etc.). The region of a resource cannot be changed once it - is created, but if an identical region is specified on update the request - will succeed. + :param location: Required. The location of the resource. This will be one of the supported and + registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. :type location: str - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :type sku: ~data_box_management_client.models.Sku + :param type: Identity type. + :type type: str + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, + ~data_box_management_client.models.UserAssignedIdentity] """ _validation = { 'location': {'required': True}, 'sku': {'required': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, } _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__(self, *, location: str, sku, tags=None, **kwargs) -> None: + 'type': {'key': 'identity.type', 'type': 'str'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + location: str, + sku: "Sku", + tags: Optional[Dict[str, str]] = None, + type: Optional[str] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.location = location self.tags = tags self.sku = sku + self.type = type + self.principal_id = None + self.tenant_id = None + self.user_assigned_identities = user_assigned_identities class JobResource(Resource): """Job Resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one - of the supported and registered Azure Regions (e.g. West US, East US, - Southeast Asia, etc.). The region of a resource cannot be changed once it - is created, but if an identical region is specified on update the request - will succeed. + :param location: Required. The location of the resource. This will be one of the supported and + registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. :type location: str - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :type sku: ~data_box_management_client.models.Sku + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, + ~data_box_management_client.models.UserAssignedIdentity] + :ivar name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param transfer_type: Required. Type of the data transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType :ivar is_cancellable: Describes whether the job is cancellable or not. :vartype is_cancellable: bool :ivar is_deletable: Describes whether the job is deletable or not. :vartype is_deletable: bool - :ivar is_shipping_address_editable: Describes whether the shipping address - is editable or not. + :ivar is_shipping_address_editable: Describes whether the shipping address is editable or not. :vartype is_shipping_address_editable: bool - :ivar status: Name of the stage which is in progress. Possible values - include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', - 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', - 'Cancelled', 'Failed_IssueReportedAtCustomer', - 'Failed_IssueDetectedAtAzureDC', 'Aborted', 'CompletedWithWarnings', - 'ReadyToDispatchFromAzureDC', 'ReadyToReceiveAtAzureDC' - :vartype status: str or ~azure.mgmt.databox.models.StageName - :ivar start_time: Time at which the job was started in UTC ISO 8601 - format. - :vartype start_time: datetime + :ivar is_prepare_to_ship_enabled: Is Prepare To Ship Enabled on this job. + :vartype is_prepare_to_ship_enabled: bool + :ivar status: Name of the stage which is in progress. Possible values include: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". + :vartype status: str or ~data_box_management_client.models.StageName + :ivar start_time: Time at which the job was started in UTC ISO 8601 format. + :vartype start_time: ~datetime.datetime :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.Error - :param details: Details of a job run. This field will only be sent for - expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~data_box_management_client.models.CloudError + :param details: Details of a job run. This field will only be sent for expand details filter. + :type details: ~data_box_management_client.models.JobDetails :ivar cancellation_reason: Reason for cancellation. :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: - 'NonScheduled', 'Scheduled' - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of - scheduled job. + :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". + :type delivery_type: str or ~data_box_management_client.models.JobDeliveryType + :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. :vartype is_cancellable_without_fee: bool - :ivar name: Name of the object. - :vartype name: str - :ivar id: Id of the object. - :vartype id: str - :ivar type: Type of the object. - :vartype type: str + :param scheduled_date_time: Scheduled date time. + :type scheduled_date_time: ~datetime.datetime """ _validation = { 'location': {'required': True}, 'sku': {'required': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'transfer_type': {'required': True}, 'is_cancellable': {'readonly': True}, 'is_deletable': {'readonly': True}, 'is_shipping_address_editable': {'readonly': True}, + 'is_prepare_to_ship_enabled': {'readonly': True}, 'status': {'readonly': True}, 'start_time': {'readonly': True}, 'error': {'readonly': True}, 'cancellation_reason': {'readonly': True}, 'is_cancellable_without_fee': {'readonly': True}, - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, } _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'transfer_type': {'key': 'properties.transferType', 'type': 'str'}, 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, 'is_deletable': {'key': 'properties.isDeletable', 'type': 'bool'}, 'is_shipping_address_editable': {'key': 'properties.isShippingAddressEditable', 'type': 'bool'}, - 'status': {'key': 'properties.status', 'type': 'StageName'}, + 'is_prepare_to_ship_enabled': {'key': 'properties.isPrepareToShipEnabled', 'type': 'bool'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'error': {'key': 'properties.error', 'type': 'Error'}, + 'error': {'key': 'properties.error', 'type': 'CloudError'}, 'details': {'key': 'properties.details', 'type': 'JobDetails'}, 'cancellation_reason': {'key': 'properties.cancellationReason', 'type': 'str'}, - 'delivery_type': {'key': 'properties.deliveryType', 'type': 'JobDeliveryType'}, - 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'JobDeliveryInfo'}, + 'delivery_type': {'key': 'properties.deliveryType', 'type': 'str'}, 'is_cancellable_without_fee': {'key': 'properties.isCancellableWithoutFee', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, location: str, sku, tags=None, details=None, delivery_type=None, delivery_info=None, **kwargs) -> None: - super(JobResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + 'scheduled_date_time': {'key': 'deliveryInfo.scheduledDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + location: str, + sku: "Sku", + transfer_type: Union[str, "TransferType"], + tags: Optional[Dict[str, str]] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + details: Optional["JobDetails"] = None, + delivery_type: Optional[Union[str, "JobDeliveryType"]] = None, + scheduled_date_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(JobResource, self).__init__(location=location, tags=tags, sku=sku, user_assigned_identities=user_assigned_identities, **kwargs) + self.name = None + self.id = None + self.type = None + self.transfer_type = transfer_type self.is_cancellable = None self.is_deletable = None self.is_shipping_address_editable = None + self.is_prepare_to_ship_enabled = None self.status = None self.start_time = None self.error = None self.details = details self.cancellation_reason = None self.delivery_type = delivery_type - self.delivery_info = delivery_info self.is_cancellable_without_fee = None - self.name = None - self.id = None - self.type = None + self.scheduled_date_time = scheduled_date_time + + +class JobResourceList(msrest.serialization.Model): + """Job Resource Collection. + + :param value: List of job resources. + :type value: list[~data_box_management_client.models.JobResource] + :param next_link: Link for the next set of job resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["JobResource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(JobResourceList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link -class JobResourceUpdateParameter(Model): +class JobResourceUpdateParameter(msrest.serialization.Model): """The JobResourceUpdateParameter. - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: - list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param tags: The list of key value pairs that describe the resource. These - tags can be used in viewing and grouping this resource (across resource - groups). + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). :type tags: dict[str, str] + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param kek_type: Type of encryption key used for key encryption. Possible values include: + "MicrosoftManaged", "CustomerManaged". + :type kek_type: str or ~data_box_management_client.models.KekType + :param kek_url: Key encryption key. It is required in case of Customer managed KekType. + :type kek_url: str + :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + KekType. + :type kek_vault_resource_id: str + :param type_details_key_encryption_key_identity_properties_type: Managed service identity type. + :type type_details_key_encryption_key_identity_properties_type: str + :param user_assigned: User assigned identity properties. + :type user_assigned: ~data_box_management_client.models.UserAssignedProperties + :param contact_name: Contact name of the person. + :type contact_name: str + :param phone: Phone number of the contact person. + :type phone: str + :param phone_extension: Phone extension number of the contact person. + :type phone_extension: str + :param mobile: Mobile number of the contact person. + :type mobile: str + :param email_list: List of Email-ids to be notified about job progress. + :type email_list: list[str] + :param notification_preference: Notification preference for a job stage. + :type notification_preference: list[~data_box_management_client.models.NotificationPreference] + :param type_identity_type: Identity type. + :type type_identity_type: str + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, + ~data_box_management_client.models.UserAssignedIdentity] """ - _attribute_map = { - 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, - 'destination_account_details': {'key': 'properties.destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, } - def __init__(self, *, details=None, destination_account_details=None, tags=None, **kwargs) -> None: + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'shipping_address': {'key': 'details.shippingAddress', 'type': 'ShippingAddress'}, + 'kek_type': {'key': 'details.keyEncryptionKey.kekType', 'type': 'str'}, + 'kek_url': {'key': 'details.keyEncryptionKey.kekUrl', 'type': 'str'}, + 'kek_vault_resource_id': {'key': 'details.keyEncryptionKey.kekVaultResourceID', 'type': 'str'}, + 'type_details_key_encryption_key_identity_properties_type': {'key': 'details.keyEncryptionKey.identityProperties.type', 'type': 'str'}, + 'user_assigned': {'key': 'details.keyEncryptionKey.identityProperties.userAssigned', 'type': 'UserAssignedProperties'}, + 'contact_name': {'key': 'details.contactDetails.contactName', 'type': 'str'}, + 'phone': {'key': 'details.contactDetails.phone', 'type': 'str'}, + 'phone_extension': {'key': 'details.contactDetails.phoneExtension', 'type': 'str'}, + 'mobile': {'key': 'details.contactDetails.mobile', 'type': 'str'}, + 'email_list': {'key': 'details.contactDetails.emailList', 'type': '[str]'}, + 'notification_preference': {'key': 'details.contactDetails.notificationPreference', 'type': '[NotificationPreference]'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + shipping_address: Optional["ShippingAddress"] = None, + kek_type: Optional[Union[str, "KekType"]] = None, + kek_url: Optional[str] = None, + kek_vault_resource_id: Optional[str] = None, + type_details_key_encryption_key_identity_properties_type: Optional[str] = None, + user_assigned: Optional["UserAssignedProperties"] = None, + contact_name: Optional[str] = None, + phone: Optional[str] = None, + phone_extension: Optional[str] = None, + mobile: Optional[str] = None, + email_list: Optional[List[str]] = None, + notification_preference: Optional[List["NotificationPreference"]] = None, + type_identity_type: Optional[str] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.details = details - self.destination_account_details = destination_account_details self.tags = tags + self.shipping_address = shipping_address + self.kek_type = kek_type + self.kek_url = kek_url + self.kek_vault_resource_id = kek_vault_resource_id + self.type_details_key_encryption_key_identity_properties_type = type_details_key_encryption_key_identity_properties_type + self.user_assigned = user_assigned + self.contact_name = contact_name + self.phone = phone + self.phone_extension = phone_extension + self.mobile = mobile + self.email_list = email_list + self.notification_preference = notification_preference + self.type_identity_type = type_identity_type + self.principal_id = None + self.tenant_id = None + self.user_assigned_identities = user_assigned_identities -class JobStages(Model): +class JobStages(msrest.serialization.Model): """Job stages. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar stage_name: Name of the job stage. Possible values include: - 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', - 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', - 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', - 'Aborted', 'CompletedWithWarnings', 'ReadyToDispatchFromAzureDC', - 'ReadyToReceiveAtAzureDC' - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + :ivar stage_name: Name of the job stage. Possible values include: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". + :vartype stage_name: str or ~data_box_management_client.models.StageName :ivar display_name: Display name of the job stage. :vartype display_name: str - :ivar stage_status: Status of the job stage. Possible values include: - 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', 'Cancelling', - 'SucceededWithErrors' - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", + "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", + "WaitingForCustomerAction", "SucceededWithWarnings". + :vartype stage_status: str or ~data_box_management_client.models.StageStatus :ivar stage_time: Time for the job stage in UTC ISO 8601 format. - :vartype stage_time: datetime - :ivar job_stage_details: Job Stage Details + :vartype stage_time: ~datetime.datetime + :ivar job_stage_details: Job Stage Details. :vartype job_stage_details: object - :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] """ _validation = { @@ -2071,37 +2706,134 @@ class JobStages(Model): 'stage_status': {'readonly': True}, 'stage_time': {'readonly': True}, 'job_stage_details': {'readonly': True}, - 'error_details': {'readonly': True}, } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'StageName'}, + 'stage_name': {'key': 'stageName', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, - 'stage_status': {'key': 'stageStatus', 'type': 'StageStatus'}, + 'stage_status': {'key': 'stageStatus', 'type': 'str'}, 'stage_time': {'key': 'stageTime', 'type': 'iso-8601'}, 'job_stage_details': {'key': 'jobStageDetails', 'type': 'object'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(JobStages, self).__init__(**kwargs) self.stage_name = None self.display_name = None self.stage_status = None self.stage_time = None self.job_stage_details = None - self.error_details = None -class NotificationPreference(Model): +class KeyEncryptionKey(msrest.serialization.Model): + """Encryption key containing details about key to encrypt different keys. + + All required parameters must be populated in order to send to Azure. + + :param kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". + :type kek_type: str or ~data_box_management_client.models.KekType + :param kek_url: Key encryption key. It is required in case of Customer managed KekType. + :type kek_url: str + :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + KekType. + :type kek_vault_resource_id: str + :param type: Managed service identity type. + :type type: str + :param user_assigned: User assigned identity properties. + :type user_assigned: ~data_box_management_client.models.UserAssignedProperties + """ + + _validation = { + 'kek_type': {'required': True}, + } + + _attribute_map = { + 'kek_type': {'key': 'kekType', 'type': 'str'}, + 'kek_url': {'key': 'kekUrl', 'type': 'str'}, + 'kek_vault_resource_id': {'key': 'kekVaultResourceID', 'type': 'str'}, + 'type': {'key': 'identityProperties.type', 'type': 'str'}, + 'user_assigned': {'key': 'identityProperties.userAssigned', 'type': 'UserAssignedProperties'}, + } + + def __init__( + self, + *, + kek_type: Union[str, "KekType"], + kek_url: Optional[str] = None, + kek_vault_resource_id: Optional[str] = None, + type: Optional[str] = None, + user_assigned: Optional["UserAssignedProperties"] = None, + **kwargs + ): + super(KeyEncryptionKey, self).__init__(**kwargs) + self.kek_type = kek_type + self.kek_url = kek_url + self.kek_vault_resource_id = kek_vault_resource_id + self.type = type + self.user_assigned = user_assigned + + +class ManagedDiskDetails(DataAccountDetails): + """Details of the managed disks. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str + :param resource_group_id: Required. Resource Group Id of the compute disks. + :type resource_group_id: str + :param staging_storage_account_id: Required. Resource Id of the storage account that can be + used to copy the vhd for staging. + :type staging_storage_account_id: str + """ + + _validation = { + 'data_account_type': {'required': True}, + 'resource_group_id': {'required': True}, + 'staging_storage_account_id': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, + 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, + 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_group_id: str, + staging_storage_account_id: str, + share_password: Optional[str] = None, + **kwargs + ): + super(ManagedDiskDetails, self).__init__(share_password=share_password, **kwargs) + self.data_account_type = 'ManagedDisk' # type: str + self.resource_group_id = resource_group_id + self.staging_storage_account_id = staging_storage_account_id + + +class NotificationPreference(msrest.serialization.Model): """Notification preference for a job stage. All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: - 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', - 'DataCopy' - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName + :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". + :type stage_name: str or ~data_box_management_client.models.NotificationStageName :param send_notification: Required. Notification is required or not. :type send_notification: bool """ @@ -2112,31 +2844,38 @@ class NotificationPreference(Model): } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'NotificationStageName'}, + 'stage_name': {'key': 'stageName', 'type': 'str'}, 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, } - def __init__(self, *, stage_name, send_notification: bool, **kwargs) -> None: + def __init__( + self, + *, + stage_name: Union[str, "NotificationStageName"], + send_notification: bool, + **kwargs + ): super(NotificationPreference, self).__init__(**kwargs) self.stage_name = stage_name self.send_notification = send_notification -class Operation(Model): +class Operation(msrest.serialization.Model): """Operation entity. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the operation. Format: - {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~data_box_management_client.models.OperationDisplay :ivar properties: Operation properties. :vartype properties: object - :ivar origin: Origin of the operation. Can be : user|system|user,system + :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool """ _validation = { @@ -2151,17 +2890,24 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'properties': {'key': 'properties', 'type': 'object'}, 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + *, + is_data_action: Optional[bool] = None, + **kwargs + ): super(Operation, self).__init__(**kwargs) self.name = None self.display = None self.properties = None self.origin = None + self.is_data_action = is_data_action -class OperationDisplay(Model): +class OperationDisplay(msrest.serialization.Model): """Operation display. :param provider: Provider name. @@ -2170,8 +2916,7 @@ class OperationDisplay(Model): :type resource: str :param operation: Localized name of the operation for display purpose. :type operation: str - :param description: Localized description of the operation for display - purpose. + :param description: Localized description of the operation for display purpose. :type description: str """ @@ -2182,7 +2927,15 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): super(OperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -2190,11 +2943,41 @@ def __init__(self, *, provider: str=None, resource: str=None, operation: str=Non self.description = description -class PackageShippingDetails(Model): +class OperationList(msrest.serialization.Model): + """Operation Collection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations. + :vartype value: list[~data_box_management_client.models.Operation] + :param next_link: Link for the next set of operations. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class PackageShippingDetails(msrest.serialization.Model): """Shipping details. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar carrier_name: Name of the carrier. :vartype carrier_name: str @@ -2216,33 +2999,45 @@ class PackageShippingDetails(Model): 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(PackageShippingDetails, self).__init__(**kwargs) self.carrier_name = None self.tracking_id = None self.tracking_url = None -class Preferences(Model): +class Preferences(msrest.serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred Data Center Region. + :param preferred_data_center_region: Preferred data center region. :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment - logistics of the sku. - :type transport_preferences: - ~azure.mgmt.databox.models.TransportPreferences + :param transport_preferences: Preferences related to the shipment logistics of the sku. + :type transport_preferences: ~data_box_management_client.models.TransportPreferences + :param encryption_preferences: Preferences related to the Encryption. + :type encryption_preferences: ~data_box_management_client.models.EncryptionPreferences """ _attribute_map = { 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, + 'encryption_preferences': {'key': 'encryptionPreferences', 'type': 'EncryptionPreferences'}, } - def __init__(self, *, preferred_data_center_region=None, transport_preferences=None, **kwargs) -> None: + def __init__( + self, + *, + preferred_data_center_region: Optional[List[str]] = None, + transport_preferences: Optional["TransportPreferences"] = None, + encryption_preferences: Optional["EncryptionPreferences"] = None, + **kwargs + ): super(Preferences, self).__init__(**kwargs) self.preferred_data_center_region = preferred_data_center_region self.transport_preferences = transport_preferences + self.encryption_preferences = encryption_preferences class PreferencesValidationRequest(ValidationInputRequest): @@ -2250,14 +3045,16 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param preference: Preference requested with respect to transport type and - data center - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param preference: Preference of transport and data center. + :type preference: ~data_box_management_client.models.Preferences + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName """ _validation = { @@ -2268,89 +3065,102 @@ class PreferencesValidationRequest(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, 'preference': {'key': 'preference', 'type': 'Preferences'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, } - def __init__(self, *, device_type, preference=None, **kwargs) -> None: + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + preference: Optional["Preferences"] = None, + **kwargs + ): super(PreferencesValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidatePreferences' # type: str self.preference = preference self.device_type = device_type - self.validation_type = 'ValidatePreferences' class PreferencesValidationResponseProperties(ValidationInputResponse): """Properties of data center and transport preference validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Validation status of requested data center and transport. - Possible values include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Validation status of requested data center and transport. Possible values + include: "Valid", "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(PreferencesValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidatePreferences' # type: str self.status = None - self.validation_type = 'ValidatePreferences' -class RegionConfigurationRequest(Model): +class RegionConfigurationRequest(msrest.serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability - for scheduling orders. + :param schedule_availability_request: Request body to get the availability for scheduling + orders. :type schedule_availability_request: - ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport - availability for given sku. - :type transport_availability_request: - ~azure.mgmt.databox.models.TransportAvailabilityRequest + ~data_box_management_client.models.ScheduleAvailabilityRequest + :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type sku_name: str or ~data_box_management_client.models.SkuName """ _attribute_map = { 'schedule_availability_request': {'key': 'scheduleAvailabilityRequest', 'type': 'ScheduleAvailabilityRequest'}, - 'transport_availability_request': {'key': 'transportAvailabilityRequest', 'type': 'TransportAvailabilityRequest'}, + 'sku_name': {'key': 'transportAvailabilityRequest.skuName', 'type': 'str'}, } - def __init__(self, *, schedule_availability_request=None, transport_availability_request=None, **kwargs) -> None: + def __init__( + self, + *, + schedule_availability_request: Optional["ScheduleAvailabilityRequest"] = None, + sku_name: Optional[Union[str, "SkuName"]] = None, + **kwargs + ): super(RegionConfigurationRequest, self).__init__(**kwargs) self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_request + self.sku_name = sku_name -class RegionConfigurationResponse(Model): +class RegionConfigurationResponse(msrest.serialization.Model): """Configuration response specific to a region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar schedule_availability_response: Schedule availability for given sku - in a region. + :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for - given sku in a region. + ~data_box_management_client.models.ScheduleAvailabilityResponse + :ivar transport_availability_response: Transport options available for given sku in a region. :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse + ~data_box_management_client.models.TransportAvailabilityResponse """ _validation = { @@ -2363,20 +3173,22 @@ class RegionConfigurationResponse(Model): 'transport_availability_response': {'key': 'transportAvailabilityResponse', 'type': 'TransportAvailabilityResponse'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(RegionConfigurationResponse, self).__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None -class ScheduleAvailabilityResponse(Model): - """Schedule availability response for given sku in a region. +class ScheduleAvailabilityResponse(msrest.serialization.Model): + """Schedule availability for given sku in a region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar available_dates: List of dates available to schedule - :vartype available_dates: list[datetime] + :ivar available_dates: List of dates available to schedule. + :vartype available_dates: list[~datetime.datetime] """ _validation = { @@ -2387,31 +3199,31 @@ class ScheduleAvailabilityResponse(Model): 'available_dates': {'key': 'availableDates', 'type': '[iso-8601]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ScheduleAvailabilityResponse, self).__init__(**kwargs) self.available_dates = None -class ShareCredentialDetails(Model): +class ShareCredentialDetails(msrest.serialization.Model): """Credential details of the shares in account. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar share_name: Name of the share. :vartype share_name: str - :ivar share_type: Type of the share. Possible values include: - 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile', 'ManagedDisk' - :vartype share_type: str or - ~azure.mgmt.databox.models.ShareDestinationFormatType + :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", + "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk", "AzurePremiumFiles". + :vartype share_type: str or ~data_box_management_client.models.ShareDestinationFormatType :ivar user_name: User name for the share. :vartype user_name: str :ivar password: Password for the share. :vartype password: str - :ivar supported_access_protocols: Access protocols supported on the - device. + :ivar supported_access_protocols: Access protocols supported on the device. :vartype supported_access_protocols: list[str or - ~azure.mgmt.databox.models.AccessProtocol] + ~data_box_management_client.models.AccessProtocol] """ _validation = { @@ -2424,13 +3236,16 @@ class ShareCredentialDetails(Model): _attribute_map = { 'share_name': {'key': 'shareName', 'type': 'str'}, - 'share_type': {'key': 'shareType', 'type': 'ShareDestinationFormatType'}, + 'share_type': {'key': 'shareType', 'type': 'str'}, 'user_name': {'key': 'userName', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, - 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[AccessProtocol]'}, + 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[str]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ShareCredentialDetails, self).__init__(**kwargs) self.share_name = None self.share_type = None @@ -2439,19 +3254,18 @@ def __init__(self, **kwargs) -> None: self.supported_access_protocols = None -class ShipmentPickUpRequest(Model): +class ShipmentPickUpRequest(msrest.serialization.Model): """Shipment pick up request details. All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should - commence, this must be in local time of pick up area. - :type start_time: datetime - :param end_time: Required. Maximum date before which the pick up should - commence, this must be in local time of pick up area. - :type end_time: datetime - :param shipment_location: Required. Shipment Location in the pickup place. - Eg.front desk + :param start_time: Required. Minimum date after which the pick up should commence, this must be + in local time of pick up area. + :type start_time: ~datetime.datetime + :param end_time: Required. Maximum date before which the pick up should commence, this must be + in local time of pick up area. + :type end_time: ~datetime.datetime + :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. :type shipment_location: str """ @@ -2467,24 +3281,30 @@ class ShipmentPickUpRequest(Model): 'shipment_location': {'key': 'shipmentLocation', 'type': 'str'}, } - def __init__(self, *, start_time, end_time, shipment_location: str, **kwargs) -> None: + def __init__( + self, + *, + start_time: datetime.datetime, + end_time: datetime.datetime, + shipment_location: str, + **kwargs + ): super(ShipmentPickUpRequest, self).__init__(**kwargs) self.start_time = start_time self.end_time = end_time self.shipment_location = shipment_location -class ShipmentPickUpResponse(Model): +class ShipmentPickUpResponse(msrest.serialization.Model): """Shipment pick up response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar confirmation_number: Confirmation number for the pick up request. :vartype confirmation_number: str - :ivar ready_by_time: Time by which shipment should be ready for pick up, - this is in local time of pick up area. - :vartype ready_by_time: datetime + :ivar ready_by_time: Time by which shipment should be ready for pick up, this is in local time + of pick up area. + :vartype ready_by_time: ~datetime.datetime """ _validation = { @@ -2497,13 +3317,16 @@ class ShipmentPickUpResponse(Model): 'ready_by_time': {'key': 'readyByTime', 'type': 'iso-8601'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ShipmentPickUpResponse, self).__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None -class ShippingAddress(Model): +class ShippingAddress(msrest.serialization.Model): """Shipping address where customer wishes to receive the device. All required parameters must be populated in order to send to Azure. @@ -2520,21 +3343,20 @@ class ShippingAddress(Model): :type state_or_province: str :param country: Required. Name of the Country. :type country: str - :param postal_code: Required. Postal code. + :param postal_code: Postal code. :type postal_code: str :param zip_extended_code: Extended Zip Code. :type zip_extended_code: str :param company_name: Name of the company. :type company_name: str - :param address_type: Type of address. Possible values include: 'None', - 'Residential', 'Commercial' - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :param address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". + :type address_type: str or ~data_box_management_client.models.AddressType """ _validation = { 'street_address1': {'required': True}, 'country': {'required': True}, - 'postal_code': {'required': True}, } _attribute_map = { @@ -2547,10 +3369,24 @@ class ShippingAddress(Model): 'postal_code': {'key': 'postalCode', 'type': 'str'}, 'zip_extended_code': {'key': 'zipExtendedCode', 'type': 'str'}, 'company_name': {'key': 'companyName', 'type': 'str'}, - 'address_type': {'key': 'addressType', 'type': 'AddressType'}, - } - - def __init__(self, *, street_address1: str, country: str, postal_code: str, street_address2: str=None, street_address3: str=None, city: str=None, state_or_province: str=None, zip_extended_code: str=None, company_name: str=None, address_type=None, **kwargs) -> None: + 'address_type': {'key': 'addressType', 'type': 'str'}, + } + + def __init__( + self, + *, + street_address1: str, + country: str, + street_address2: Optional[str] = None, + street_address3: Optional[str] = None, + city: Optional[str] = None, + state_or_province: Optional[str] = None, + postal_code: Optional[str] = None, + zip_extended_code: Optional[str] = None, + company_name: Optional[str] = None, + address_type: Optional[Union[str, "AddressType"]] = None, + **kwargs + ): super(ShippingAddress, self).__init__(**kwargs) self.street_address1 = street_address1 self.street_address2 = street_address2 @@ -2564,14 +3400,14 @@ def __init__(self, *, street_address1: str, country: str, postal_code: str, stre self.address_type = address_type -class Sku(Model): +class Sku(msrest.serialization.Model): """The Sku. All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: 'DataBox', - 'DataBoxDisk', 'DataBoxHeavy' - :type name: str or ~azure.mgmt.databox.models.SkuName + :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :type name: str or ~data_box_management_client.models.SkuName :param display_name: The display name of the sku. :type display_name: str :param family: The sku family. @@ -2583,12 +3419,19 @@ class Sku(Model): } _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, + 'name': {'key': 'name', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, *, name, display_name: str=None, family: str=None, **kwargs) -> None: + def __init__( + self, + *, + name: Union[str, "SkuName"], + display_name: Optional[str] = None, + family: Optional[str] = None, + **kwargs + ): super(Sku, self).__init__(**kwargs) self.name = name self.display_name = display_name @@ -2598,95 +3441,104 @@ def __init__(self, *, name, display_name: str=None, family: str=None, **kwargs) class SkuAvailabilityValidationRequest(ValidationInputRequest): """Request to validate sku availability. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar transfer_type: Required. Type of the transfer. Default value: - "ImportToAzure" . - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. - For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :type transfer_type: str or ~data_box_management_client.models.TransferType + :param country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. :type country: str - :param location: Required. Location for data transfer. For locations - check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + :param location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. :type location: str """ _validation = { 'validation_type': {'required': True}, 'device_type': {'required': True}, - 'transfer_type': {'required': True, 'constant': True}, + 'transfer_type': {'required': True}, 'country': {'required': True}, 'location': {'required': True}, } _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, 'transfer_type': {'key': 'transferType', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, } - transfer_type = "ImportToAzure" - - def __init__(self, *, device_type, country: str, location: str, **kwargs) -> None: + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + transfer_type: Union[str, "TransferType"], + country: str, + location: str, + **kwargs + ): super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateSkuAvailability' # type: str self.device_type = device_type + self.transfer_type = transfer_type self.country = country self.location = location - self.validation_type = 'ValidateSkuAvailability' class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): """Properties of sku availability validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Sku availability validation status. Possible values include: - 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", + "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateSkuAvailability' # type: str self.status = None - self.validation_type = 'ValidateSkuAvailability' -class SkuCapacity(Model): +class SkuCapacity(msrest.serialization.Model): """Capacity of the sku. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar usable: Usable capacity in TB. :vartype usable: str @@ -2704,65 +3556,73 @@ class SkuCapacity(Model): 'maximum': {'key': 'maximum', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SkuCapacity, self).__init__(**kwargs) self.usable = None self.maximum = None -class SkuCost(Model): +class SkuCost(msrest.serialization.Model): """Describes metadata for retrieving price info. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar meter_id: Meter id of the Sku. :vartype meter_id: str :ivar meter_type: The type of the meter. :vartype meter_type: str + :ivar multiplier: Multiplier specifies the region specific value to be multiplied with 1$ guid. + Eg: Our new regions will be using 1$ shipping guid with appropriate multiplier specific to + region. + :vartype multiplier: float """ _validation = { 'meter_id': {'readonly': True}, 'meter_type': {'readonly': True}, + 'multiplier': {'readonly': True}, } _attribute_map = { 'meter_id': {'key': 'meterId', 'type': 'str'}, 'meter_type': {'key': 'meterType', 'type': 'str'}, + 'multiplier': {'key': 'multiplier', 'type': 'float'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SkuCost, self).__init__(**kwargs) self.meter_id = None self.meter_type = None + self.multiplier = None -class SkuInformation(Model): +class SkuInformation(msrest.serialization.Model): """Information of the sku. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :vartype sku: ~data_box_management_client.models.Sku :ivar enabled: The sku is enabled or not. :vartype enabled: bool - :ivar destination_to_service_location_map: The map of destination location - to service location. - :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.models.DestinationToServiceLocationMap] + :ivar data_location_to_service_location_map: The map of data location to service location. + :vartype data_location_to_service_location_map: + list[~data_box_management_client.models.DataLocationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~data_box_management_client.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :vartype costs: list[~data_box_management_client.models.SkuCost] :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] - :ivar disabled_reason: Reason why the Sku is disabled. Possible values - include: 'None', 'Country', 'Region', 'Feature', 'OfferType', - 'NoSubscriptionInfo' - :vartype disabled_reason: str or - ~azure.mgmt.databox.models.SkuDisabledReason + :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", + "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". + :vartype disabled_reason: str or ~data_box_management_client.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. :vartype disabled_reason_message: str :ivar required_feature: Required feature to access the sku. @@ -2772,7 +3632,7 @@ class SkuInformation(Model): _validation = { 'sku': {'readonly': True}, 'enabled': {'readonly': True}, - 'destination_to_service_location_map': {'readonly': True}, + 'data_location_to_service_location_map': {'readonly': True}, 'capacity': {'readonly': True}, 'costs': {'readonly': True}, 'api_versions': {'readonly': True}, @@ -2784,20 +3644,23 @@ class SkuInformation(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'destination_to_service_location_map': {'key': 'properties.destinationToServiceLocationMap', 'type': '[DestinationToServiceLocationMap]'}, + 'data_location_to_service_location_map': {'key': 'properties.dataLocationToServiceLocationMap', 'type': '[DataLocationToServiceLocationMap]'}, 'capacity': {'key': 'properties.capacity', 'type': 'SkuCapacity'}, 'costs': {'key': 'properties.costs', 'type': '[SkuCost]'}, 'api_versions': {'key': 'properties.apiVersions', 'type': '[str]'}, - 'disabled_reason': {'key': 'properties.disabledReason', 'type': 'SkuDisabledReason'}, + 'disabled_reason': {'key': 'properties.disabledReason', 'type': 'str'}, 'disabled_reason_message': {'key': 'properties.disabledReasonMessage', 'type': 'str'}, 'required_feature': {'key': 'properties.requiredFeature', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SkuInformation, self).__init__(**kwargs) self.sku = None self.enabled = None - self.destination_to_service_location_map = None + self.data_location_to_service_location_map = None self.capacity = None self.costs = None self.api_versions = None @@ -2806,13 +3669,58 @@ def __init__(self, **kwargs) -> None: self.required_feature = None +class StorageAccountDetails(DataAccountDetails): + """Details for the storage account. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :type share_password: str + :param storage_account_id: Required. Storage Account Resource Id. + :type storage_account_id: str + """ + + _validation = { + 'data_account_type': {'required': True}, + 'storage_account_id': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_id: str, + share_password: Optional[str] = None, + **kwargs + ): + super(StorageAccountDetails, self).__init__(share_password=share_password, **kwargs) + self.data_account_type = 'StorageAccount' # type: str + self.storage_account_id = storage_account_id + + class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): """Request to validate subscription permission to create jobs. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator """ _validation = { @@ -2823,98 +3731,254 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): 'validation_type': {'key': 'validationType', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' + self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): """Properties of subscription permission to create job validation response. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :param validation_type: Required. Constant filled by server. - :type validation_type: str - :ivar status: Validation status of subscription permission to create job. - Possible values include: 'Valid', 'Invalid', 'Skipped' - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~data_box_management_client.models.CloudError + :ivar status: Validation status of subscription permission to create job. Possible values + include: "Valid", "Invalid", "Skipped". + :vartype status: str or ~data_box_management_client.models.ValidationStatus """ _validation = { - 'error': {'readonly': True}, 'validation_type': {'required': True}, + 'error': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'Error'}, 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'ValidationStatus'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str self.status = None - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' -class TransportAvailabilityDetails(Model): - """Transport options availability details for given region. +class TransferAllDetails(msrest.serialization.Model): + """Details to transfer all data. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar shipment_type: Transport Shipment Type supported for given region. - Possible values include: 'CustomerManaged', 'MicrosoftManaged' - :vartype shipment_type: str or - ~azure.mgmt.databox.models.TransportShipmentTypes + :param data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :type transfer_all_blobs: bool + :param transfer_all_files: To indicate if all Azure Files have to be transferred. + :type transfer_all_files: bool """ _validation = { - 'shipment_type': {'readonly': True}, + 'data_account_type': {'required': True}, } _attribute_map = { - 'shipment_type': {'key': 'shipmentType', 'type': 'TransportShipmentTypes'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'transfer_all_blobs': {'key': 'transferAllBlobs', 'type': 'bool'}, + 'transfer_all_files': {'key': 'transferAllFiles', 'type': 'bool'}, } - def __init__(self, **kwargs) -> None: - super(TransportAvailabilityDetails, self).__init__(**kwargs) - self.shipment_type = None + def __init__( + self, + *, + data_account_type: Union[str, "DataAccountType"], + transfer_all_blobs: Optional[bool] = None, + transfer_all_files: Optional[bool] = None, + **kwargs + ): + super(TransferAllDetails, self).__init__(**kwargs) + self.data_account_type = data_account_type + self.transfer_all_blobs = transfer_all_blobs + self.transfer_all_files = transfer_all_files + + +class TransferConfiguration(msrest.serialization.Model): + """Configuration for defining the transfer of data. + + All required parameters must be populated in order to send to Azure. + :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible + values include: "TransferAll", "TransferUsingFilter". + :type transfer_configuration_type: str or + ~data_box_management_client.models.TransferConfigurationType + :param transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :type transfer_filter_details: + ~data_box_management_client.models.TransferConfigurationTransferFilterDetails + :param transfer_all_details: Map of filter type and the details to transfer all data. This + field is required only if the TransferConfigurationType is given as TransferAll. + :type transfer_all_details: + ~data_box_management_client.models.TransferConfigurationTransferAllDetails + """ -class TransportAvailabilityRequest(Model): - """Request body to get the transport availability for given sku. + _validation = { + 'transfer_configuration_type': {'required': True}, + } - :param sku_name: Type of the device. Possible values include: 'DataBox', - 'DataBoxDisk', 'DataBoxHeavy' - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + _attribute_map = { + 'transfer_configuration_type': {'key': 'transferConfigurationType', 'type': 'str'}, + 'transfer_filter_details': {'key': 'transferFilterDetails', 'type': 'TransferConfigurationTransferFilterDetails'}, + 'transfer_all_details': {'key': 'transferAllDetails', 'type': 'TransferConfigurationTransferAllDetails'}, + } + + def __init__( + self, + *, + transfer_configuration_type: Union[str, "TransferConfigurationType"], + transfer_filter_details: Optional["TransferConfigurationTransferFilterDetails"] = None, + transfer_all_details: Optional["TransferConfigurationTransferAllDetails"] = None, + **kwargs + ): + super(TransferConfiguration, self).__init__(**kwargs) + self.transfer_configuration_type = transfer_configuration_type + self.transfer_filter_details = transfer_filter_details + self.transfer_all_details = transfer_all_details + + +class TransferConfigurationTransferAllDetails(msrest.serialization.Model): + """Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll. + + :param include: Details to transfer all data. + :type include: ~data_box_management_client.models.TransferAllDetails """ _attribute_map = { - 'sku_name': {'key': 'skuName', 'type': 'SkuName'}, + 'include': {'key': 'include', 'type': 'TransferAllDetails'}, } - def __init__(self, *, sku_name=None, **kwargs) -> None: - super(TransportAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = sku_name + def __init__( + self, + *, + include: Optional["TransferAllDetails"] = None, + **kwargs + ): + super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) + self.include = include + + +class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): + """Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. + + :param include: Details of the filtering the transfer of data. + :type include: ~data_box_management_client.models.TransferFilterDetails + """ + + _attribute_map = { + 'include': {'key': 'include', 'type': 'TransferFilterDetails'}, + } + + def __init__( + self, + *, + include: Optional["TransferFilterDetails"] = None, + **kwargs + ): + super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) + self.include = include + + +class TransferFilterDetails(msrest.serialization.Model): + """Details of the filtering the transfer of data. + + All required parameters must be populated in order to send to Azure. + + :param data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :type data_account_type: str or ~data_box_management_client.models.DataAccountType + :param blob_filter_details: Filter details to transfer blobs. + :type blob_filter_details: ~data_box_management_client.models.BlobFilterDetails + :param azure_file_filter_details: Filter details to transfer Azure files. + :type azure_file_filter_details: ~data_box_management_client.models.AzureFileFilterDetails + :param filter_file_details: Details of the filter files to be used for data transfer. + :type filter_file_details: list[~data_box_management_client.models.FilterFileDetails] + """ + + _validation = { + 'data_account_type': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'blob_filter_details': {'key': 'blobFilterDetails', 'type': 'BlobFilterDetails'}, + 'azure_file_filter_details': {'key': 'azureFileFilterDetails', 'type': 'AzureFileFilterDetails'}, + 'filter_file_details': {'key': 'filterFileDetails', 'type': '[FilterFileDetails]'}, + } + + def __init__( + self, + *, + data_account_type: Union[str, "DataAccountType"], + blob_filter_details: Optional["BlobFilterDetails"] = None, + azure_file_filter_details: Optional["AzureFileFilterDetails"] = None, + filter_file_details: Optional[List["FilterFileDetails"]] = None, + **kwargs + ): + super(TransferFilterDetails, self).__init__(**kwargs) + self.data_account_type = data_account_type + self.blob_filter_details = blob_filter_details + self.azure_file_filter_details = azure_file_filter_details + self.filter_file_details = filter_file_details + + +class TransportAvailabilityDetails(msrest.serialization.Model): + """Transport options availability details for given region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar shipment_type: Transport Shipment Type supported for given region. Possible values + include: "CustomerManaged", "MicrosoftManaged". + :vartype shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes + """ + + _validation = { + 'shipment_type': {'readonly': True}, + } + + _attribute_map = { + 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TransportAvailabilityDetails, self).__init__(**kwargs) + self.shipment_type = None -class TransportAvailabilityResponse(Model): +class TransportAvailabilityResponse(msrest.serialization.Model): """Transport options available for given sku in a region. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar transport_availability_details: List of transport availability - details for given region + :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~data_box_management_client.models.TransportAvailabilityDetails] """ _validation = { @@ -2925,21 +3989,22 @@ class TransportAvailabilityResponse(Model): 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(TransportAvailabilityResponse, self).__init__(**kwargs) self.transport_availability_details = None -class TransportPreferences(Model): +class TransportPreferences(msrest.serialization.Model): """Preferences related to the shipment logistics of the sku. All required parameters must be populated in order to send to Azure. - :param preferred_shipment_type: Required. Indicates Shipment Logistics - type that the customer preferred. Possible values include: - 'CustomerManaged', 'MicrosoftManaged' - :type preferred_shipment_type: str or - ~azure.mgmt.databox.models.TransportShipmentTypes + :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". + :type preferred_shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes """ _validation = { @@ -2947,24 +4012,28 @@ class TransportPreferences(Model): } _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'TransportShipmentTypes'}, + 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, } - def __init__(self, *, preferred_shipment_type, **kwargs) -> None: + def __init__( + self, + *, + preferred_shipment_type: Union[str, "TransportShipmentTypes"], + **kwargs + ): super(TransportPreferences, self).__init__(**kwargs) self.preferred_shipment_type = preferred_shipment_type -class UnencryptedCredentials(Model): +class UnencryptedCredentials(msrest.serialization.Model): """Unencrypted credentials for accessing device. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar job_name: Name of the job. :vartype job_name: str :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets + :vartype job_secrets: ~data_box_management_client.models.JobSecrets """ _validation = { @@ -2977,49 +4046,110 @@ class UnencryptedCredentials(Model): 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(UnencryptedCredentials, self).__init__(**kwargs) self.job_name = None self.job_secrets = None -class UpdateJobDetails(Model): - """Job details for update. +class UnencryptedCredentialsList(msrest.serialization.Model): + """List of unencrypted credentials for accessing device. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :param value: List of unencrypted credentials. + :type value: list[~data_box_management_client.models.UnencryptedCredentials] + :param next_link: Link for the next set of unencrypted credentials. + :type next_link: str """ _attribute_map = { - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, + 'value': {'key': 'value', 'type': '[UnencryptedCredentials]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, *, contact_details=None, shipping_address=None, **kwargs) -> None: - super(UpdateJobDetails, self).__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address + def __init__( + self, + *, + value: Optional[List["UnencryptedCredentials"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(UnencryptedCredentialsList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class UserAssignedIdentity(msrest.serialization.Model): + """Class defining User assigned identity details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class UserAssignedProperties(msrest.serialization.Model): + """User assigned identity properties. + + :param resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :type resource_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + **kwargs + ): + super(UserAssignedProperties, self).__init__(**kwargs) + self.resource_id = resource_id class ValidateAddress(ValidationInputRequest): - """The requirements to validate customer address where the device needs to be - shipped. + """The requirements to validate customer address where the device needs to be shipped. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Constant filled by server. - :type validation_type: str + :param validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", + "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", + "ValidateSkuAvailability", "ValidateDataTransferDetails". + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible - values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment - logistics of the sku. - :type transport_preferences: - ~azure.mgmt.databox.models.TransportPreferences + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :type device_type: str or ~data_box_management_client.models.SkuName + :param preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. + Possible values include: "CustomerManaged", "MicrosoftManaged". + :type preferred_shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes """ _validation = { @@ -3031,32 +4161,37 @@ class ValidateAddress(ValidationInputRequest): _attribute_map = { 'validation_type': {'key': 'validationType', 'type': 'str'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'device_type': {'key': 'deviceType', 'type': 'SkuName'}, - 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, - } - - def __init__(self, *, shipping_address, device_type, transport_preferences=None, **kwargs) -> None: + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'preferred_shipment_type': {'key': 'transportPreferences.preferredShipmentType', 'type': 'str'}, + } + + def __init__( + self, + *, + shipping_address: "ShippingAddress", + device_type: Union[str, "SkuName"], + preferred_shipment_type: Optional[Union[str, "TransportShipmentTypes"]] = None, + **kwargs + ): super(ValidateAddress, self).__init__(**kwargs) + self.validation_type = 'ValidateAddress' # type: str self.shipping_address = shipping_address self.device_type = device_type - self.transport_preferences = transport_preferences - self.validation_type = 'ValidateAddress' + self.preferred_shipment_type = preferred_shipment_type -class ValidationResponse(Model): +class ValidationResponse(msrest.serialization.Model): """Response of pre job creation validations. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: Overall validation status. Possible values include: - 'AllValidToProceed', 'InputsRevisitRequired', - 'CertainInputValidationsSkipped' - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus - :ivar individual_response_details: List of response details contain - validationType and its response as key and value respectively. + :ivar status: Overall validation status. Possible values include: "AllValidToProceed", + "InputsRevisitRequired", "CertainInputValidationsSkipped". + :vartype status: str or ~data_box_management_client.models.OverallValidationStatus + :ivar individual_response_details: List of response details contain validationType and its + response as key and value respectively. :vartype individual_response_details: - list[~azure.mgmt.databox.models.ValidationInputResponse] + list[~data_box_management_client.models.ValidationInputResponse] """ _validation = { @@ -3065,11 +4200,14 @@ class ValidationResponse(Model): } _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'OverallValidationStatus'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ValidationResponse, self).__init__(**kwargs) self.status = None self.individual_response_details = None diff --git a/src/databox/azext_databox/vendored_sdks/databox/operations/__init__.py b/src/databox/azext_databox/vendored_sdks/databox/operations/__init__.py index 034974abbcc..dfc73af8ef4 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/operations/__init__.py +++ b/src/databox/azext_databox/vendored_sdks/databox/operations/__init__.py @@ -1,20 +1,17 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._operations import Operations -from ._jobs_operations import JobsOperations +from ._operation_operations import OperationOperations +from ._job_operations import JobOperations from ._service_operations import ServiceOperations __all__ = [ - 'Operations', - 'JobsOperations', + 'OperationOperations', + 'JobOperations', 'ServiceOperations', ] diff --git a/src/databox/azext_databox/vendored_sdks/databox/operations/_job_operations.py b/src/databox/azext_databox/vendored_sdks/databox/operations/_job_operations.py new file mode 100644 index 00000000000..d96a8e2d9fb --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/operations/_job_operations.py @@ -0,0 +1,988 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +import datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class JobOperations(object): + """JobOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.JobResourceList"] + """Lists all the jobs available under the subscription. + + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_management_client.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.JobResourceList"] + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_management_client.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + + def get( + self, + resource_group_name, # type: str + job_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.JobResource" + """Gets information about the specified job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param expand: $expand is supported on details parameter for job, which provides details on the + job stages. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~data_box_management_client.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + job_name, # type: str + location, # type: str + sku, # type: "models.Sku" + transfer_type, # type: Union[str, "models.TransferType"] + tags=None, # type: Optional[Dict[str, str]] + type=None, # type: Optional[str] + user_assigned_identities=None, # type: Optional[Dict[str, "models.UserAssignedIdentity"]] + details=None, # type: Optional["models.JobDetails"] + delivery_type=None, # type: Optional[Union[str, "models.JobDeliveryType"]] + scheduled_date_time=None, # type: Optional[datetime.datetime] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.JobResource"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + job_resource = models.JobResource(location=location, tags=tags, sku=sku, type=type, user_assigned_identities=user_assigned_identities, transfer_type=transfer_type, details=details, delivery_type=delivery_type, scheduled_date_time=scheduled_date_time) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(job_resource, 'JobResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + job_name, # type: str + location, # type: str + sku, # type: "models.Sku" + transfer_type, # type: Union[str, "models.TransferType"] + tags=None, # type: Optional[Dict[str, str]] + type=None, # type: Optional[str] + user_assigned_identities=None, # type: Optional[Dict[str, "models.UserAssignedIdentity"]] + details=None, # type: Optional["models.JobDetails"] + delivery_type=None, # type: Optional[Union[str, "models.JobDeliveryType"]] + scheduled_date_time=None, # type: Optional[datetime.datetime] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.JobResource"] + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param location: The location of the resource. This will be one of the supported and registered + Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be + changed once it is created, but if an identical region is specified on update the request will + succeed. + :type location: str + :param sku: The sku type. + :type sku: ~data_box_management_client.models.Sku + :param transfer_type: Type of the data transfer. + :type transfer_type: str or ~data_box_management_client.models.TransferType + :param tags: The list of key value pairs that describe the resource. These tags can be used in + viewing and grouping this resource (across resource groups). + :type tags: dict[str, str] + :param type: Identity type. + :type type: str + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, ~data_box_management_client.models.UserAssignedIdentity] + :param details: Details of a job run. This field will only be sent for expand details filter. + :type details: ~data_box_management_client.models.JobDetails + :param delivery_type: Delivery type of Job. + :type delivery_type: str or ~data_box_management_client.models.JobDeliveryType + :param scheduled_date_time: Scheduled date time. + :type scheduled_date_time: ~datetime.datetime + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_management_client.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + location=location, + sku=sku, + transfer_type=transfer_type, + tags=tags, + type=type, + user_assigned_identities=user_assigned_identities, + details=details, + delivery_type=delivery_type, + scheduled_date_time=scheduled_date_time, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + job_name=job_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + job_name, # type: str + if_match=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + shipping_address=None, # type: Optional["models.ShippingAddress"] + kek_type=None, # type: Optional[Union[str, "models.KekType"]] + kek_url=None, # type: Optional[str] + kek_vault_resource_id=None, # type: Optional[str] + type=None, # type: Optional[str] + user_assigned=None, # type: Optional["models.UserAssignedProperties"] + contact_name=None, # type: Optional[str] + phone=None, # type: Optional[str] + phone_extension=None, # type: Optional[str] + mobile=None, # type: Optional[str] + email_list=None, # type: Optional[List[str]] + notification_preference=None, # type: Optional[List["models.NotificationPreference"]] + user_assigned_identities=None, # type: Optional[Dict[str, "models.UserAssignedIdentity"]] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.JobResource"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + job_resource_update_parameter = models.JobResourceUpdateParameter(tags=tags, shipping_address=shipping_address, kek_type=kek_type, kek_url=kek_url, kek_vault_resource_id=kek_vault_resource_id, type_details_key_encryption_key_identity_properties_type=type, user_assigned=user_assigned, contact_name=contact_name, phone=phone, phone_extension=phone_extension, mobile=mobile, email_list=email_list, notification_preference=notification_preference, user_assigned_identities=user_assigned_identities) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + job_name, # type: str + if_match=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + shipping_address=None, # type: Optional["models.ShippingAddress"] + kek_type=None, # type: Optional[Union[str, "models.KekType"]] + kek_url=None, # type: Optional[str] + kek_vault_resource_id=None, # type: Optional[str] + type=None, # type: Optional[str] + user_assigned=None, # type: Optional["models.UserAssignedProperties"] + contact_name=None, # type: Optional[str] + phone=None, # type: Optional[str] + phone_extension=None, # type: Optional[str] + mobile=None, # type: Optional[str] + email_list=None, # type: Optional[List[str]] + notification_preference=None, # type: Optional[List["models.NotificationPreference"]] + user_assigned_identities=None, # type: Optional[Dict[str, "models.UserAssignedIdentity"]] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.JobResource"] + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the job on the server matches this value. + :type if_match: str + :param tags: The list of key value pairs that describe the resource. These tags can be used in + viewing and grouping this resource (across resource groups). + :type tags: dict[str, str] + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param kek_type: Type of encryption key used for key encryption. + :type kek_type: str or ~data_box_management_client.models.KekType + :param kek_url: Key encryption key. It is required in case of Customer managed KekType. + :type kek_url: str + :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + KekType. + :type kek_vault_resource_id: str + :param type: Managed service identity type. + :type type: str + :param user_assigned: User assigned identity properties. + :type user_assigned: ~data_box_management_client.models.UserAssignedProperties + :param contact_name: Contact name of the person. + :type contact_name: str + :param phone: Phone number of the contact person. + :type phone: str + :param phone_extension: Phone extension number of the contact person. + :type phone_extension: str + :param mobile: Mobile number of the contact person. + :type mobile: str + :param email_list: List of Email-ids to be notified about job progress. + :type email_list: list[str] + :param notification_preference: Notification preference for a job stage. + :type notification_preference: list[~data_box_management_client.models.NotificationPreference] + :param user_assigned_identities: User Assigned Identities. + :type user_assigned_identities: dict[str, ~data_box_management_client.models.UserAssignedIdentity] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_management_client.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + if_match=if_match, + tags=tags, + shipping_address=shipping_address, + kek_type=kek_type, + kek_url=kek_url, + kek_vault_resource_id=kek_vault_resource_id, + type=type, + user_assigned=user_assigned, + contact_name=contact_name, + phone=phone, + phone_extension=phone_extension, + mobile=mobile, + email_list=email_list, + notification_preference=notification_preference, + user_assigned_identities=user_assigned_identities, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def book_shipment_pick_up( + self, + resource_group_name, # type: str + job_name, # type: str + start_time, # type: datetime.datetime + end_time, # type: datetime.datetime + shipment_location, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ShipmentPickUpResponse" + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param start_time: Minimum date after which the pick up should commence, this must be in local + time of pick up area. + :type start_time: ~datetime.datetime + :param end_time: Maximum date before which the pick up should commence, this must be in local + time of pick up area. + :type end_time: ~datetime.datetime + :param shipment_location: Shipment Location in the pickup place. Eg.front desk. + :type shipment_location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShipmentPickUpResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ShipmentPickUpResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShipmentPickUpResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + shipment_pick_up_request = models.ShipmentPickUpRequest(start_time=start_time, end_time=end_time, shipment_location=shipment_location) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.book_shipment_pick_up.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + def cancel( + self, + resource_group_name, # type: str + job_name, # type: str + reason, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """CancelJob. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :param reason: Reason for cancellation. + :type reason: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + cancellation_reason = models.CancellationReason(reason=reason) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.cancel.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(cancellation_reason, 'CancellationReason') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + def list_credentials( + self, + resource_group_name, # type: str + job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.UnencryptedCredentialsList"] + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_management_client.models.UnencryptedCredentialsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UnencryptedCredentialsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/operations/_operation_operations.py b/src/databox/azext_databox/vendored_sdks/databox/operations/_operation_operations.py new file mode 100644 index 00000000000..e38bac2344d --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/operations/_operation_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationList"] + """This method gets all the operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_management_client.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ApiError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/operations/_service_operations.py b/src/databox/azext_databox/vendored_sdks/databox/operations/_service_operations.py index c595d5511f4..8cfcb36c6c0 100644 --- a/src/databox/azext_databox/vendored_sdks/databox/operations/_service_operations.py +++ b/src/databox/azext_databox/vendored_sdks/databox/operations/_service_operations.py @@ -1,469 +1,399 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ServiceOperations(object): """ServiceOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API Version. Constant value: "2019-09-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01" + self._config = config + + def validate_address( + self, + location, # type: str + validation_type, # type: Union[str, "models.ValidationInputDiscriminator"] + shipping_address, # type: "models.ShippingAddress" + device_type, # type: Union[str, "models.SkuName"] + preferred_shipment_type=None, # type: Optional[Union[str, "models.TransportShipmentTypes"]] + **kwargs # type: Any + ): + # type: (...) -> "models.AddressValidationOutput" + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The location of the resource. + :type location: str + :param validation_type: Identifies the type of validation request. + :type validation_type: str or ~data_box_management_client.models.ValidationInputDiscriminator + :param shipping_address: Shipping address of the customer. + :type shipping_address: ~data_box_management_client.models.ShippingAddress + :param device_type: Device type to be used for the job. + :type device_type: str or ~data_box_management_client.models.SkuName + :param preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. + :type preferred_shipment_type: str or ~data_box_management_client.models.TransportShipmentTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressValidationOutput, or the result of cls(response) + :rtype: ~data_box_management_client.models.AddressValidationOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AddressValidationOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) - self.config = config + validate_address = models.ValidateAddress(validation_type=validation_type, shipping_address=shipping_address, device_type=device_type, preferred_shipment_type=preferred_shipment_type) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" - def list_available_skus( - self, location, available_sku_request, custom_headers=None, raw=False, **operation_config): - """This method provides the list of available skus for the given - subscription and location. + # Construct URL + url = self.validate_address.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - :param location: The location of the resource - :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: - ~azure.mgmt.databox.models.AvailableSkuRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of SkuInformation - :rtype: - ~azure.mgmt.databox.models.SkuInformationPaged[~azure.mgmt.databox.models.SkuInformation] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_available_skus.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.SkuInformationPaged(internal_paging, self._deserialize.dependencies, header_dict) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - return deserialized - list_available_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - def list_available_skus_by_resource_group( - self, resource_group_name, location, available_sku_request, custom_headers=None, raw=False, **operation_config): - """This method provides the list of available skus for the given - subscription, resource group and location. + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_address, 'ValidateAddress') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response - :param resource_group_name: The Resource Group Name - :type resource_group_name: str - :param location: The location of the resource - :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: - ~azure.mgmt.databox.models.AvailableSkuRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of SkuInformation - :rtype: - ~azure.mgmt.databox.models.SkuInformationPaged[~azure.mgmt.databox.models.SkuInformation] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.SkuInformationPaged(internal_paging, self._deserialize.dependencies, header_dict) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return deserialized - list_available_skus_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} + deserialized = self._deserialize('AddressValidationOutput', pipeline_response) - def validate_address_method( - self, location, validate_address, custom_headers=None, raw=False, **operation_config): - """[DEPRECATED NOTICE: This operation will soon be removed] This method - validates the customer shipping address and provide alternate addresses - if any. + if cls: + return cls(pipeline_response, deserialized, {}) - :param location: The location of the resource + return deserialized + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + + def validate_input_by_resource_group( + self, + resource_group_name, # type: str + location, # type: str + validation_request, # type: "models.ValidationRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.ValidationResponse" + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. :type location: str - :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AddressValidationOutput or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.databox.models.AddressValidationOutput or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :param validation_request: Inputs of the customer. + :type validation_request: ~data_box_management_client.models.ValidationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.validate_address_method.metadata['url'] + url = self.validate_input_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(validate_address, 'ValidateAddress') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validation_request, 'ValidationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AddressValidationOutput', response) + deserialized = self._deserialize('ValidationResponse', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - validate_address_method.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} - - def validate_inputs_by_resource_group( - self, resource_group_name, location, validation_request, custom_headers=None, raw=False, **operation_config): - """This method does all necessary pre-job creation validation under - resource group. - - :param resource_group_name: The Resource Group Name - :type resource_group_name: str - :param location: The location of the resource + validate_input_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + def validate_input( + self, + location, # type: str + validation_request, # type: "models.ValidationRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.ValidationResponse" + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ValidationResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.databox.models.ValidationResponse or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :type validation_request: ~data_box_management_client.models.ValidationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] + url = self.validate_input.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(validation_request, 'ValidationRequest') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validation_request, 'ValidationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ValidationResponse', response) + deserialized = self._deserialize('ValidationResponse', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - validate_inputs_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} - - def validate_inputs( - self, location, validation_request, custom_headers=None, raw=False, **operation_config): - """This method does all necessary pre-job creation validation under - subscription. + validate_input.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore - :param location: The location of the resource + def region_configuration( + self, + location, # type: str + schedule_availability_request=None, # type: Optional["models.ScheduleAvailabilityRequest"] + sku_name=None, # type: Optional[Union[str, "models.SkuName"]] + **kwargs # type: Any + ): + # type: (...) -> "models.RegionConfigurationResponse" + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ValidationResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.databox.models.ValidationResponse or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :param schedule_availability_request: Request body to get the availability for scheduling + orders. + :type schedule_availability_request: ~data_box_management_client.models.ScheduleAvailabilityRequest + :param sku_name: Type of the device. + :type sku_name: str or ~data_box_management_client.models.SkuName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegionConfigurationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + region_configuration_request = models.RegionConfigurationRequest(schedule_availability_request=schedule_availability_request, sku_name=sku_name) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.validate_inputs.metadata['url'] + url = self.region_configuration.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(validation_request, 'ValidationRequest') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ValidationResponse', response) + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} - - def region_configuration( - self, location, schedule_availability_request=None, transport_availability_request=None, custom_headers=None, raw=False, **operation_config): - """This API provides configuration details specific to given - region/location. - - :param location: The location of the resource + region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + def region_configuration_by_resource_group( + self, + resource_group_name, # type: str + location, # type: str + schedule_availability_request=None, # type: Optional["models.ScheduleAvailabilityRequest"] + sku_name=None, # type: Optional[Union[str, "models.SkuName"]] + **kwargs # type: Any + ): + # type: (...) -> "models.RegionConfigurationResponse" + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. :type location: str - :param schedule_availability_request: Request body to get the - availability for scheduling orders. - :type schedule_availability_request: - ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the - transport availability for given sku. - :type transport_availability_request: - ~azure.mgmt.databox.models.TransportAvailabilityRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: RegionConfigurationResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :param schedule_availability_request: Request body to get the availability for scheduling + orders. + :type schedule_availability_request: ~data_box_management_client.models.ScheduleAvailabilityRequest + :param sku_name: Type of the device. + :type sku_name: str or ~data_box_management_client.models.SkuName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegionConfigurationResponse, or the result of cls(response) + :rtype: ~data_box_management_client.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError """ - region_configuration_request = models.RegionConfigurationRequest(schedule_availability_request=schedule_availability_request, transport_availability_request=transport_availability_request) + cls = kwargs.pop('cls', None) # type: ClsType["models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + region_configuration_request = models.RegionConfigurationRequest(schedule_availability_request=schedule_availability_request, sku_name=sku_name) + api_version = "2020-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.region_configuration.metadata['url'] + url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ApiError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('RegionConfigurationResponse', response) + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore diff --git a/src/databox/azext_databox/vendored_sdks/databox/py.typed b/src/databox/azext_databox/vendored_sdks/databox/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/databox/azext_databox/vendored_sdks/databox/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/databox/report.md b/src/databox/report.md new file mode 100644 index 00000000000..ff4d5da99e1 --- /dev/null +++ b/src/databox/report.md @@ -0,0 +1,351 @@ +# Azure CLI Module Creation Report + +## EXTENSION +|CLI Extension|Command Groups| +|---------|------------| +|az databox|[groups](#CommandGroups) + +## GROUPS +### Command groups in `az databox` extension +|CLI Command Group|Group Swagger name|Commands| +|---------|------------|--------| +|az databox job|Jobs|[commands](#CommandsInJobs)| +|az databox service|Service|[commands](#CommandsInService)| + +## COMMANDS +### Commands in `az databox job` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databox job list](#JobsListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersJobsListByResourceGroup)|[Example](#ExamplesJobsListByResourceGroup)| +|[az databox job list](#JobsList)|List|[Parameters](#ParametersJobsList)|[Example](#ExamplesJobsList)| +|[az databox job show](#JobsGet)|Get|[Parameters](#ParametersJobsGet)|[Example](#ExamplesJobsGet)| +|[az databox job create](#JobsCreate)|Create|[Parameters](#ParametersJobsCreate)|[Example](#ExamplesJobsCreate)| +|[az databox job update](#JobsUpdate)|Update|[Parameters](#ParametersJobsUpdate)|[Example](#ExamplesJobsUpdate)| +|[az databox job delete](#JobsDelete)|Delete|[Parameters](#ParametersJobsDelete)|[Example](#ExamplesJobsDelete)| +|[az databox job book-shipment-pick-up](#JobsBookShipmentPickUp)|BookShipmentPickUp|[Parameters](#ParametersJobsBookShipmentPickUp)|[Example](#ExamplesJobsBookShipmentPickUp)| +|[az databox job cancel](#JobsCancel)|Cancel|[Parameters](#ParametersJobsCancel)|[Example](#ExamplesJobsCancel)| +|[az databox job list-credentials](#JobsListCredentials)|ListCredentials|[Parameters](#ParametersJobsListCredentials)|[Example](#ExamplesJobsListCredentials)| + +### Commands in `az databox service` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databox service region-configuration](#ServiceRegionConfiguration)|RegionConfiguration|[Parameters](#ParametersServiceRegionConfiguration)|[Example](#ExamplesServiceRegionConfiguration)| +|[az databox service region-configuration-by-resource-group](#ServiceRegionConfigurationByResourceGroup)|RegionConfigurationByResourceGroup|[Parameters](#ParametersServiceRegionConfigurationByResourceGroup)|[Example](#ExamplesServiceRegionConfigurationByResourceGroup)| +|[az databox service validate-address](#ServiceValidateAddress)|ValidateAddress|[Parameters](#ParametersServiceValidateAddress)|[Example](#ExamplesServiceValidateAddress)| +|[az databox service validate-input](#ServiceValidateInputs)|ValidateInputs|[Parameters](#ParametersServiceValidateInputs)|[Example](#ExamplesServiceValidateInputs)| +|[az databox service validate-input-by-resource-group](#ServiceValidateInputsByResourceGroup)|ValidateInputsByResourceGroup|[Parameters](#ParametersServiceValidateInputsByResourceGroup)|[Example](#ExamplesServiceValidateInputsByResourceGroup)| + + +## COMMAND DETAILS + +### group `az databox job` +#### Command `az databox job list` + +##### Example +``` +az databox job list --resource-group "SdkRg5154" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--skip-token**|string|$skipToken is supported on Get list of jobs, which provides the next page in the list of jobs.|skip_token|$skipToken| + +#### Command `az databox job list` + +##### Example +``` +az databox job list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az databox job show` + +##### Example +``` +az databox job show --expand "details" --name "SdkJob952" --resource-group "SdkRg5154" +``` +##### Example +``` +az databox job show --expand "details" --name "SdkJob1735" --resource-group "SdkRg7937" +``` +##### Example +``` +az databox job show --expand "details" --name "SdkJob6429" --resource-group "SdkRg8091" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| +|**--expand**|string|$expand is supported on details parameter for job, which provides details on the job stages.|expand|$expand| + +#### Command `az databox job create` + +##### Example +``` +az databox job create --name "SdkJob952" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/\ +databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\ +\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\ +\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg5154" +``` +##### Example +``` +az databox job create --name "SdkJob9640" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"sharePassword\\":\\"Abcd223@22344Abcd223@22344\\",\\"storageAccountId\\":\\"/subscriptions\ +/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvt\ +testaccount2\\"}}],\\"devicePassword\\":\\"Abcd223@22344\\",\\"jobDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{\ +\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\ +\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg7478" +``` +##### Example +``` +az databox job create --name "SdkJob6599" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/\ +databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\ +\\"preferences\\":{\\"encryptionPreferences\\":{\\"doubleEncryption\\":\\"Enabled\\"}},\\"shippingAddress\\":{\\"addres\ +sType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"po\ +stalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg608" +``` +##### Example +``` +az databox job create --name "SdkJob6429" --location "westus" --transfer-type "ExportFromAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataExportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/\ +akvenkat/providers/Microsoft.Storage/storageAccounts/aaaaaa2\\"},\\"transferConfiguration\\":{\\"transferAllDetails\\":\ +{\\"include\\":{\\"dataAccountType\\":\\"StorageAccount\\",\\"transferAllBlobs\\":true,\\"transferAllFiles\\":true}},\\\ +"transferConfigurationType\\":\\"TransferAll\\"}}],\\"jobDetailsType\\":\\"DataBox\\",\\"shippingAddress\\":{\\"address\ +Type\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"pos\ +talCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND \ +ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg8091" +``` +##### Example +``` +az databox job create --name "SdkJob5337" --identity-type "UserAssigned" --identity-user-assigned-identities \ +"{\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/us\ +erAssignedIdentities/sdkIdentity\\":{}}" --location "westus" --transfer-type "ImportToAzure" --details \ +"{\\"contactDetails\\":{\\"contactName\\":\\"Public SDK Test\\",\\"emailList\\":[\\"testing@microsoft.com\\"],\\"phone\ +\\":\\"1234567890\\",\\"phoneExtension\\":\\"1234\\"},\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountTyp\ +e\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/\ +databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount2\\"}}],\\"jobDetailsType\\":\\"DataBox\\"\ +,\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsof\ +t\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"}}" --sku name="DataBox" --resource-group "SdkRg7552" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| +|**--location**|string|The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed.|location|location| +|**--sku**|object|The sku type.|sku|sku| +|**--transfer-type**|sealed-choice|Type of the data transfer.|transfer_type|transferType| +|**--tags**|dictionary|The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups).|tags|tags| +|**--identity-type**|string|Identity type|type|type| +|**--identity-user-assigned-identities**|dictionary|User Assigned Identities|user_assigned_identities|userAssignedIdentities| +|**--details**|object|Details of a job run. This field will only be sent for expand details filter.|details|details| +|**--delivery-type**|sealed-choice|Delivery type of Job.|delivery_type|deliveryType| +|**--delivery-info-scheduled-date-time**|date-time|Scheduled date time.|scheduled_date_time|scheduledDateTime| + +#### Command `az databox job update` + +##### Example +``` +az databox job update --name "SdkJob952" --resource-group "SdkRg5154" +``` +##### Example +``` +az databox job update --name "SdkJob1735" --resource-group "SdkRg7937" +``` +##### Example +``` +az databox job update --name "SdkJob2965" --identity-user-assigned-identities "{\\"/subscriptions/fa68082f-8ff7-4a25-95\ +c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sdkIdentity\\":{}}" \ +--resource-group "SdkRg9765" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| +|**--if-match**|string|Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value.|if_match|If-Match| +|**--tags**|dictionary|The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups).|tags|tags| +|**--details-shipping-address**|object|Shipping address of the customer.|shipping_address|shippingAddress| +|**--details-key-encryption-key-kek-type**|sealed-choice|Type of encryption key used for key encryption.|kek_type|kekType| +|**--details-key-encryption-key-kek-url**|string|Key encryption key. It is required in case of Customer managed KekType.|kek_url|kekUrl| +|**--details-key-encryption-key-kek-vault-resource-id**|string|Kek vault resource id. It is required in case of Customer managed KekType.|kek_vault_resource_id|kekVaultResourceID| +|**--details-key-encryption-key-identity-properties-type**|string|Managed service identity type.|type|type| +|**--details-key-encryption-key-identity-properties-user-assigned**|object|User assigned identity properties.|user_assigned|userAssigned| +|**--details-contact-details-contact-name**|string|Contact name of the person.|contact_name|contactName| +|**--details-contact-details-phone**|string|Phone number of the contact person.|phone|phone| +|**--details-contact-details-phone-extension**|string|Phone extension number of the contact person.|phone_extension|phoneExtension| +|**--details-contact-details-mobile**|string|Mobile number of the contact person.|mobile|mobile| +|**--details-contact-details-email-list**|array|List of Email-ids to be notified about job progress.|email_list|emailList| +|**--details-contact-details-notification-preference**|array|Notification preference for a job stage.|notification_preference|notificationPreference| +|**--identity-user-assigned-identities**|dictionary|User Assigned Identities|user_assigned_identities|userAssignedIdentities| + +#### Command `az databox job delete` + +##### Example +``` +az databox job delete --name "SdkJob952" --resource-group "SdkRg5154" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| + +#### Command `az databox job book-shipment-pick-up` + +##### Example +``` +az databox job book-shipment-pick-up --name "TJ-636646322037905056" --resource-group "bvttoolrg6" --end-time \ +"2019-09-22T18:30:00Z" --shipment-location "Front desk" --start-time "2019-09-20T18:30:00Z" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| +|**--start-time**|date-time|Minimum date after which the pick up should commence, this must be in local time of pick up area.|start_time|startTime| +|**--end-time**|date-time|Maximum date before which the pick up should commence, this must be in local time of pick up area.|end_time|endTime| +|**--shipment-location**|string|Shipment Location in the pickup place. Eg.front desk|shipment_location|shipmentLocation| + +#### Command `az databox job cancel` + +##### Example +``` +az databox job cancel --reason "CancelTest" --name "SdkJob952" --resource-group "SdkRg5154" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| +|**--reason**|string|Reason for cancellation.|reason|reason| + +#### Command `az databox job list-credentials` + +##### Example +``` +az databox job list-credentials --name "TJ-636646322037905056" --resource-group "bvttoolrg6" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--job-name**|string|The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only|job_name|jobName| + +### group `az databox service` +#### Command `az databox service region-configuration` + +##### Example +``` +az databox service region-configuration --location "westus" --schedule-availability-request \ +"{\\"skuName\\":\\"DataBox\\",\\"storageLocation\\":\\"westus\\"}" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--location**|string|The location of the resource|location|location| +|**--data-box-schedule-availability-request**|object|Request body to get the availability for scheduling data box orders orders.|data_box_schedule_availability_request|DataBoxScheduleAvailabilityRequest| +|**--disk-schedule-availability-request**|object|Request body to get the availability for scheduling disk orders.|disk_schedule_availability_request|DiskScheduleAvailabilityRequest| +|**--heavy-schedule-availability-request**|object|Request body to get the availability for scheduling heavy orders.|heavy_schedule_availability_request|HeavyScheduleAvailabilityRequest| +|**--transport-availability-request-sku-name**|sealed-choice|Type of the device.|sku_name|skuName| + +#### Command `az databox service region-configuration-by-resource-group` + +##### Example +``` +az databox service region-configuration-by-resource-group --location "westus" --schedule-availability-request \ +"{\\"skuName\\":\\"DataBox\\",\\"storageLocation\\":\\"westus\\"}" --resource-group "SdkRg4981" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--location**|string|The location of the resource|location|location| +|**--data-box-schedule-availability-request**|object|Request body to get the availability for scheduling data box orders orders.|data_box_schedule_availability_request|DataBoxScheduleAvailabilityRequest| +|**--disk-schedule-availability-request**|object|Request body to get the availability for scheduling disk orders.|disk_schedule_availability_request|DiskScheduleAvailabilityRequest| +|**--heavy-schedule-availability-request**|object|Request body to get the availability for scheduling heavy orders.|heavy_schedule_availability_request|HeavyScheduleAvailabilityRequest| +|**--transport-availability-request-sku-name**|sealed-choice|Type of the device.|sku_name|skuName| + +#### Command `az databox service validate-address` + +##### Example +``` +az databox service validate-address --location "westus" --device-type "DataBox" --shipping-address \ +address-type="Commercial" city="San Francisco" company-name="Microsoft" country="US" postal-code="94107" \ +state-or-province="CA" street-address1="16 TOWNSEND ST" street-address2="Unit 1" --validation-type "ValidateAddress" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--location**|string|The location of the resource|location|location| +|**--validation-type**|sealed-choice|Identifies the type of validation request.|validation_type|validationType| +|**--shipping-address**|object|Shipping address of the customer.|shipping_address|shippingAddress| +|**--device-type**|sealed-choice|Device type to be used for the job.|device_type|deviceType| +|**--transport-preferences-preferred-shipment-type**|sealed-choice|Indicates Shipment Logistics type that the customer preferred.|preferred_shipment_type|preferredShipmentType| + +#### Command `az databox service validate-input` + +##### Example +``` +az databox service validate-input --location "westus" --validation-request "{\\"individualRequestDetails\\":[{\\"dataIm\ +portDetails\\":[{\\"accountDetails\\":{\\"dataAccountType\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscripti\ +ons/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxb\ +vttestaccount\\"}}],\\"deviceType\\":\\"DataBox\\",\\"transferType\\":\\"ImportToAzure\\",\\"validationType\\":\\"Valid\ +ateDataTransferDetails\\"},{\\"deviceType\\":\\"DataBox\\",\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\\ +"city\\":\\"San Francisco\\",\\"companyName\\":\\"Microsoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"s\ +tateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit \ +1\\"},\\"transportPreferences\\":{\\"preferredShipmentType\\":\\"MicrosoftManaged\\"},\\"validationType\\":\\"ValidateA\ +ddress\\"},{\\"validationType\\":\\"ValidateSubscriptionIsAllowedToCreateJob\\"},{\\"country\\":\\"US\\",\\"deviceType\ +\\":\\"DataBox\\",\\"location\\":\\"westus\\",\\"transferType\\":\\"ImportToAzure\\",\\"validationType\\":\\"ValidateSk\ +uAvailability\\"},{\\"deviceType\\":\\"DataBox\\",\\"validationType\\":\\"ValidateCreateOrderLimit\\"},{\\"deviceType\\\ +":\\"DataBox\\",\\"preference\\":{\\"transportPreferences\\":{\\"preferredShipmentType\\":\\"MicrosoftManaged\\"}},\\"v\ +alidationType\\":\\"ValidatePreferences\\"}],\\"validationCategory\\":\\"JobCreationValidation\\"}" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--location**|string|The location of the resource|location|location| +|**--create-job-validations**|object|It does all pre-job creation validations.|create_job_validations|CreateJobValidations| + +#### Command `az databox service validate-input-by-resource-group` + +##### Example +``` +az databox service validate-input-by-resource-group --location "westus" --resource-group "SdkRg6861" \ +--validation-request "{\\"individualRequestDetails\\":[{\\"dataImportDetails\\":[{\\"accountDetails\\":{\\"dataAccountT\ +ype\\":\\"StorageAccount\\",\\"storageAccountId\\":\\"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroup\ +s/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\\"}}],\\"deviceType\\":\\"DataBox\\",\\"\ +transferType\\":\\"ImportToAzure\\",\\"validationType\\":\\"ValidateDataTransferDetails\\"},{\\"deviceType\\":\\"DataBo\ +x\\",\\"shippingAddress\\":{\\"addressType\\":\\"Commercial\\",\\"city\\":\\"San Francisco\\",\\"companyName\\":\\"Micr\ +osoft\\",\\"country\\":\\"US\\",\\"postalCode\\":\\"94107\\",\\"stateOrProvince\\":\\"CA\\",\\"streetAddress1\\":\\"16 \ +TOWNSEND ST\\",\\"streetAddress2\\":\\"Unit 1\\"},\\"transportPreferences\\":{\\"preferredShipmentType\\":\\"MicrosoftM\ +anaged\\"},\\"validationType\\":\\"ValidateAddress\\"},{\\"validationType\\":\\"ValidateSubscriptionIsAllowedToCreateJo\ +b\\"},{\\"country\\":\\"US\\",\\"deviceType\\":\\"DataBox\\",\\"location\\":\\"westus\\",\\"transferType\\":\\"ImportTo\ +Azure\\",\\"validationType\\":\\"ValidateSkuAvailability\\"},{\\"deviceType\\":\\"DataBox\\",\\"validationType\\":\\"Va\ +lidateCreateOrderLimit\\"},{\\"deviceType\\":\\"DataBox\\",\\"preference\\":{\\"transportPreferences\\":{\\"preferredSh\ +ipmentType\\":\\"MicrosoftManaged\\"}},\\"validationType\\":\\"ValidatePreferences\\"}],\\"validationCategory\\":\\"Job\ +CreationValidation\\"}" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The Resource Group Name|resource_group_name|resourceGroupName| +|**--location**|string|The location of the resource|location|location| +|**--create-job-validations**|object|It does all pre-job creation validations.|create_job_validations|CreateJobValidations| diff --git a/src/databox/setup.cfg b/src/databox/setup.cfg index 3c6e79cf31d..2fdd96e5d39 100644 --- a/src/databox/setup.cfg +++ b/src/databox/setup.cfg @@ -1,2 +1 @@ -[bdist_wheel] -universal=1 +#setup.cfg \ No newline at end of file diff --git a/src/databox/setup.py b/src/databox/setup.py index b7768ea142b..ed1ec325aa7 100644 --- a/src/databox/setup.py +++ b/src/databox/setup.py @@ -8,15 +8,13 @@ from codecs import open from setuptools import setup, find_packages -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") -# TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. VERSION = '0.1.0' +try: + from azext_databox.manual.version import VERSION +except ImportError: + pass # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -26,17 +24,19 @@ 'Intended Audience :: System Administrators', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ] -# TODO: Add any additional SDK dependencies here DEPENDENCIES = [] +try: + from azext_databox.manual.dependency import DEPENDENCIES +except ImportError: + pass + with open('README.md', 'r', encoding='utf-8') as f: README = f.read() with open('HISTORY.rst', 'r', encoding='utf-8') as f: @@ -45,8 +45,7 @@ setup( name='databox', version=VERSION, - description='Microsoft Azure Command-Line Tools DataBox Extension', - # TODO: Update author and email, if applicable + description='Microsoft Azure Command-Line Tools DataBoxManagementClient Extension', author='Microsoft Corporation', author_email='azpycli@microsoft.com', url='https://github.com/Azure/azure-cli-extensions/tree/master/src/databox',