From b951b8b60cdb556755b0a8fd92b620a583b15475 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Mon, 6 Jul 2026 05:14:56 +0000 Subject: [PATCH 1/4] Configurations: 'specification/databox/resource-manager/Microsoft.DataBox/DataBox/tspconfig.yaml', API Version: 2025-07-01, SDK Release Type: beta, and CommitSHA: '6c19e3347d60ee62bccec0b56680ca79a162b99b' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6521705 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- sdk/databox/azure-mgmt-databox/CHANGELOG.md | 69 + sdk/databox/azure-mgmt-databox/MANIFEST.in | 9 +- sdk/databox/azure-mgmt-databox/README.md | 6 +- sdk/databox/azure-mgmt-databox/_meta.json | 11 - sdk/databox/azure-mgmt-databox/_metadata.json | 11 + sdk/databox/azure-mgmt-databox/api.md | 4928 ++++++++++++ .../azure-mgmt-databox/api.metadata.yml | 3 + .../apiview-properties.json | 205 + .../azure-mgmt-databox/azure/__init__.py | 2 +- .../azure-mgmt-databox/azure/mgmt/__init__.py | 2 +- .../azure/mgmt/databox/__init__.py | 4 +- ...ta_box_management_client.py => _client.py} | 72 +- .../azure/mgmt/databox/_configuration.py | 32 +- .../azure/mgmt/databox/_patch.py | 13 +- .../azure/mgmt/databox/_utils/__init__.py | 6 + .../azure/mgmt/databox/_utils/model_base.py | 1770 +++++ .../serialization.py} | 355 +- .../azure/mgmt/databox/_utils/utils.py | 57 + .../azure/mgmt/databox/_vendor.py | 25 - .../azure/mgmt/databox/_version.py | 4 +- .../azure/mgmt/databox/aio/__init__.py | 4 +- ...ta_box_management_client.py => _client.py} | 74 +- .../azure/mgmt/databox/aio/_configuration.py | 32 +- .../azure/mgmt/databox/aio/_patch.py | 13 +- .../azure/mgmt/databox/aio/_vendor.py | 25 - .../mgmt/databox/aio/operations/__init__.py | 9 +- .../_data_box_management_client_operations.py | 168 - .../aio/operations/_jobs_operations.py | 1303 ---- .../databox/aio/operations/_operations.py | 2893 ++++++- .../mgmt/databox/aio/operations/_patch.py | 13 +- .../aio/operations/_service_operations.py | 830 -- .../azure/mgmt/databox/models/__init__.py | 30 +- ...x_management_client_enums.py => _enums.py} | 123 +- .../azure/mgmt/databox/models/_models.py | 5932 +++++++++++++++ .../azure/mgmt/databox/models/_models_py3.py | 6669 ----------------- .../azure/mgmt/databox/models/_patch.py | 13 +- .../azure/mgmt/databox/operations/__init__.py | 9 +- .../_data_box_management_client_operations.py | 203 - .../databox/operations/_jobs_operations.py | 1612 ---- .../mgmt/databox/operations/_operations.py | 3396 ++++++++- .../azure/mgmt/databox/operations/_patch.py | 13 +- .../databox/operations/_service_operations.py | 1021 --- .../azure/mgmt/databox/types.py | 3639 +++++++++ .../generated_samples/available_skus_post.py | 6 +- .../book_shipment_pickup_post.py | 6 +- .../generated_samples/job_mitigate.py | 6 +- .../generated_samples/jobs_cancel_post.py | 6 +- .../generated_samples/jobs_create.py | 7 +- .../jobs_create_device_password.py | 7 +- .../jobs_create_double_encryption.py | 7 +- .../generated_samples/jobs_create_export.py | 7 +- ...jobs_create_with_user_assigned_identity.py | 7 +- .../generated_samples/jobs_delete.py | 6 +- .../generated_samples/jobs_get.py | 6 +- .../generated_samples/jobs_get_cmk.py | 6 +- .../generated_samples/jobs_get_copy_stuck.py | 6 +- .../generated_samples/jobs_get_export.py | 6 +- .../jobs_get_waiting_for_action.py | 6 +- .../generated_samples/jobs_list.py | 6 +- .../jobs_list_by_resource_group.py | 6 +- .../jobs_list_credentials.py | 6 +- .../generated_samples/jobs_patch.py | 6 +- .../generated_samples/jobs_patch_cmk.py | 7 +- ..._patch_system_assigned_to_user_assigned.py | 7 +- .../generated_samples/mark_devices_shipped.py | 6 +- .../generated_samples/operations_get.py | 4 +- .../generated_samples/region_configuration.py | 6 +- .../region_configuration_by_resource_group.py | 6 +- .../validate_address_post.py | 6 +- .../generated_samples/validate_inputs.py | 7 +- .../validate_inputs_by_resource_group.py | 7 +- .../generated_tests/conftest.py | 2 +- .../test_data_box_management.py | 3 +- .../test_data_box_management_async.py | 3 +- ...est_data_box_management_jobs_operations.py | 249 +- ...ta_box_management_jobs_operations_async.py | 253 +- .../test_data_box_management_operations.py | 6 +- ...st_data_box_management_operations_async.py | 6 +- ..._data_box_management_service_operations.py | 58 +- ...box_management_service_operations_async.py | 58 +- sdk/databox/azure-mgmt-databox/pyproject.toml | 82 + .../azure-mgmt-databox/sdk_packaging.toml | 6 - sdk/databox/azure-mgmt-databox/setup.py | 83 - .../azure-mgmt-databox/tsp-location.yaml | 4 + 84 files changed, 23852 insertions(+), 12744 deletions(-) delete mode 100644 sdk/databox/azure-mgmt-databox/_meta.json create mode 100644 sdk/databox/azure-mgmt-databox/_metadata.json create mode 100644 sdk/databox/azure-mgmt-databox/api.md create mode 100644 sdk/databox/azure-mgmt-databox/api.metadata.yml create mode 100644 sdk/databox/azure-mgmt-databox/apiview-properties.json rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{_data_box_management_client.py => _client.py} (62%) create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/model_base.py rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{_serialization.py => _utils/serialization.py} (88%) create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/utils.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_vendor.py rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/{_data_box_management_client.py => _client.py} (63%) delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_service_operations.py rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/{_data_box_management_client_enums.py => _enums.py} (88%) create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_models.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/types.py delete mode 100644 sdk/databox/azure-mgmt-databox/sdk_packaging.toml delete mode 100644 sdk/databox/azure-mgmt-databox/setup.py create mode 100644 sdk/databox/azure-mgmt-databox/tsp-location.yaml diff --git a/sdk/databox/azure-mgmt-databox/CHANGELOG.md b/sdk/databox/azure-mgmt-databox/CHANGELOG.md index 63343b92b81e..ff80ecb10fac 100644 --- a/sdk/databox/azure-mgmt-databox/CHANGELOG.md +++ b/sdk/databox/azure-mgmt-databox/CHANGELOG.md @@ -1,5 +1,74 @@ # Release History +## 4.0.0b1 (2026-07-06) + +### Features Added + + - Client `DataBoxManagementClient` added parameter `cloud_setting` in method `__init__` + - Client `DataBoxManagementClient` added method `send_request` + - Model `DeviceErasureDetails` added property `secure_erasure_certificate_sas_key` + - Model `JobResource` added property `properties` + - Model `JobResourceUpdateParameter` added property `properties` + - Model `SkuInformation` added property `properties` + - Added enum `CreatedByType` + - Added model `JobProperties` + - Added model `OperationProperties` + - Added model `SkuProperties` + - Added model `TrackedResource` + - Added model `UpdateJobProperties` + - Added model `ValidationResponseProperties` + - Model `JobsOperations` added parameter `etag` in method `begin_update` + - Model `JobsOperations` added parameter `match_condition` in method `begin_update` + +### Breaking Changes + + - Model `AddressValidationOutput` deleted or renamed its instance variable `validation_type` + - Model `AddressValidationOutput` deleted or renamed its instance variable `error` + - Model `AddressValidationOutput` deleted or renamed its instance variable `validation_status` + - Model `AddressValidationOutput` deleted or renamed its instance variable `alternate_addresses` + - Model `JobResource` deleted or renamed its instance variable `transfer_type` + - Model `JobResource` deleted or renamed its instance variable `is_cancellable` + - Model `JobResource` deleted or renamed its instance variable `is_deletable` + - Model `JobResource` deleted or renamed its instance variable `is_shipping_address_editable` + - Model `JobResource` deleted or renamed its instance variable `reverse_shipping_details_update` + - Model `JobResource` deleted or renamed its instance variable `reverse_transport_preference_update` + - Model `JobResource` deleted or renamed its instance variable `is_prepare_to_ship_enabled` + - Model `JobResource` deleted or renamed its instance variable `status` + - Model `JobResource` deleted or renamed its instance variable `delayed_stage` + - Model `JobResource` deleted or renamed its instance variable `start_time` + - Model `JobResource` deleted or renamed its instance variable `error` + - Model `JobResource` deleted or renamed its instance variable `details` + - Model `JobResource` deleted or renamed its instance variable `cancellation_reason` + - Model `JobResource` deleted or renamed its instance variable `delivery_type` + - Model `JobResource` deleted or renamed its instance variable `delivery_info` + - Model `JobResource` deleted or renamed its instance variable `is_cancellable_without_fee` + - Model `JobResource` deleted or renamed its instance variable `all_devices_lost` + - Model `JobResourceUpdateParameter` deleted or renamed its instance variable `details` + - Model `Resource` deleted or renamed its instance variable `location` + - Model `Resource` deleted or renamed its instance variable `tags` + - Model `Resource` deleted or renamed its instance variable `sku` + - Model `Resource` deleted or renamed its instance variable `identity` + - Model `SkuInformation` deleted or renamed its instance variable `data_location_to_service_location_map` + - Model `SkuInformation` deleted or renamed its instance variable `capacity` + - Model `SkuInformation` deleted or renamed its instance variable `costs` + - Model `SkuInformation` deleted or renamed its instance variable `api_versions` + - Model `SkuInformation` deleted or renamed its instance variable `disabled_reason` + - Model `SkuInformation` deleted or renamed its instance variable `disabled_reason_message` + - Model `SkuInformation` deleted or renamed its instance variable `required_feature` + - Model `SkuInformation` deleted or renamed its instance variable `countries_within_commerce_boundary` + - Model `ValidationResponse` deleted or renamed its instance variable `status` + - Model `ValidationResponse` deleted or renamed its instance variable `individual_response_details` + - Deleted or renamed model `ArmBaseObject` + - Deleted or renamed model `AvailableSkusResult` + - Deleted or renamed model `JobResourceList` + - Deleted or renamed model `OperationList` + - Deleted or renamed model `UnencryptedCredentialsList` + - Method `JobsOperations.begin_update` deleted or renamed its parameter `if_match` of kind `positional_or_keyword` + - Method `JobsOperations.get` changed its parameter `expand` from `positional_or_keyword` to `keyword_only` + - Method `JobsOperations.list` changed its parameter `skip_token` from `positional_or_keyword` to `keyword_only` + - Method `JobsOperations.list_by_resource_group` changed its parameter `skip_token` from `positional_or_keyword` to `keyword_only` + - Deleted or renamed model `DataBoxManagementClientOperationsMixin` + ## 3.1.0 (2025-03-18) ### Features Added diff --git a/sdk/databox/azure-mgmt-databox/MANIFEST.in b/sdk/databox/azure-mgmt-databox/MANIFEST.in index b60e34f8314e..de3b30f407d0 100644 --- a/sdk/databox/azure-mgmt-databox/MANIFEST.in +++ b/sdk/databox/azure-mgmt-databox/MANIFEST.in @@ -1,8 +1,7 @@ -include _meta.json -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/databox/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/databox/azure-mgmt-databox/README.md b/sdk/databox/azure-mgmt-databox/README.md index 85e029bff6d3..a075023296e8 100644 --- a/sdk/databox/azure-mgmt-databox/README.md +++ b/sdk/databox/azure-mgmt-databox/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Data Box Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/databox/azure-mgmt-databox/_meta.json b/sdk/databox/azure-mgmt-databox/_meta.json deleted file mode 100644 index b18fb523d52f..000000000000 --- a/sdk/databox/azure-mgmt-databox/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "4cecf11996f2bfc7958f6d0de814badab23f9720", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.10.2", - "use": [ - "@autorest/python@6.27.4", - "@autorest/modelerfour@4.27.0" - ], - "autorest_command": "autorest specification/databox/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", - "readme": "specification/databox/resource-manager/readme.md" -} \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/_metadata.json b/sdk/databox/azure-mgmt-databox/_metadata.json new file mode 100644 index 000000000000..aafc90ad23b9 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/_metadata.json @@ -0,0 +1,11 @@ +{ + "apiVersion": "2025-07-01", + "apiVersions": { + "Microsoft.DataBox": "2025-07-01" + }, + "commit": "6c19e3347d60ee62bccec0b56680ca79a162b99b", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/databox/resource-manager/Microsoft.DataBox/DataBox", + "emitterVersion": "0.63.2", + "httpClientPythonVersion": "^0.34.0" +} \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/api.md b/sdk/databox/azure-mgmt-databox/api.md new file mode 100644 index 000000000000..6a86b18dc883 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/api.md @@ -0,0 +1,4928 @@ +```py +namespace azure.mgmt.databox + + class azure.mgmt.databox.DataBoxManagementClient(_DataBoxManagementClientOperationsMixin): implements ContextManager + jobs: JobsOperations + operations: Operations + service: ServiceOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + @overload + def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: MitigateJobRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: MitigateJobRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.databox.aio + + class azure.mgmt.databox.aio.DataBoxManagementClient(_DataBoxManagementClientOperationsMixin): implements AsyncContextManager + jobs: JobsOperations + operations: Operations + service: ServiceOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + @overload + async def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: MitigateJobRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + async def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: MitigateJobRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + async def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.databox.aio.operations + + class azure.mgmt.databox.aio.operations.JobsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[JobResource]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[JobResource]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[JobResource]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: JobResourceUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> AsyncLROPoller[JobResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: JobResourceUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> AsyncLROPoller[JobResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> AsyncLROPoller[JobResource]: ... + + @overload + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ShipmentPickUpResponse: ... + + @overload + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ShipmentPickUpResponse: ... + + @overload + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ShipmentPickUpResponse: ... + + @overload + async def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + async def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + async def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + job_name: str, + *, + expand: Optional[str] = ..., + **kwargs: Any + ) -> JobResource: ... + + @distributed_trace + def list( + self, + *, + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[JobResource]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + *, + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[JobResource]: ... + + @distributed_trace + def list_credentials( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> AsyncItemPaged[UnencryptedCredentials]: ... + + @overload + async def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: MarkDevicesShippedRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + async def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: MarkDevicesShippedRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + async def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + + class azure.mgmt.databox.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.databox.aio.operations.ServiceOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: AvailableSkuRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[SkuInformation]: ... + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: AvailableSkuRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[SkuInformation]: ... + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[SkuInformation]: ... + + @overload + async def region_configuration( + self, + location: str, + region_configuration_request: RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + async def region_configuration( + self, + location: str, + region_configuration_request: RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + async def region_configuration( + self, + location: str, + region_configuration_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + async def validate_address( + self, + location: str, + validate_address: ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AddressValidationOutput: ... + + @overload + async def validate_address( + self, + location: str, + validate_address: ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AddressValidationOutput: ... + + @overload + async def validate_address( + self, + location: str, + validate_address: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AddressValidationOutput: ... + + @overload + async def validate_inputs( + self, + location: str, + validation_request: ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + @overload + async def validate_inputs( + self, + location: str, + validation_request: ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + @overload + async def validate_inputs( + self, + location: str, + validation_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + +namespace azure.mgmt.databox.models + + class azure.mgmt.databox.models.AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NFS = "NFS" + SMB = "SMB" + + + class azure.mgmt.databox.models.AccountCredentialDetails(_Model): + account_connection_string: Optional[str] + account_name: Optional[str] + data_account_type: Optional[Union[str, DataAccountType]] + share_credential_details: Optional[list[ShareCredentialDetails]] + + + class azure.mgmt.databox.models.AdditionalErrorInfo(_Model): + info: Optional[dict[str, Any]] + type: Optional[str] + + @overload + def __init__( + self, + *, + info: Optional[dict[str, Any]] = ..., + type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMMERCIAL = "Commercial" + NONE = "None" + RESIDENTIAL = "Residential" + + + class azure.mgmt.databox.models.AddressValidationOutput(_Model): + properties: Optional[AddressValidationProperties] + + + class azure.mgmt.databox.models.AddressValidationProperties(ValidationInputResponse, discriminator='ValidateAddress'): + alternate_addresses: Optional[list[ShippingAddress]] + error: CloudError + validation_status: Optional[Union[str, AddressValidationStatus]] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AMBIGUOUS = "Ambiguous" + INVALID = "Invalid" + VALID = "Valid" + + + class azure.mgmt.databox.models.ApiError(_Model): + error: ErrorDetail + + @overload + def __init__( + self, + *, + error: ErrorDetail + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ApplianceNetworkConfiguration(_Model): + mac_address: Optional[str] + name: Optional[str] + + + class azure.mgmt.databox.models.AvailableSkuRequest(_Model): + country: str + location: str + sku_names: Optional[list[Union[str, SkuName]]] + transfer_type: Union[str, TransferType] + + @overload + def __init__( + self, + *, + country: str, + location: str, + sku_names: Optional[list[Union[str, SkuName]]] = ..., + transfer_type: Union[str, TransferType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.AzureFileFilterDetails(_Model): + file_path_list: Optional[list[str]] + file_prefix_list: Optional[list[str]] + file_share_list: Optional[list[str]] + + @overload + def __init__( + self, + *, + file_path_list: Optional[list[str]] = ..., + file_prefix_list: Optional[list[str]] = ..., + file_share_list: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.BlobFilterDetails(_Model): + blob_path_list: Optional[list[str]] + blob_prefix_list: Optional[list[str]] + container_list: Optional[list[str]] + + @overload + def __init__( + self, + *, + blob_path_list: Optional[list[str]] = ..., + blob_prefix_list: Optional[list[str]] = ..., + container_list: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.CancellationReason(_Model): + reason: str + + @overload + def __init__( + self, + *, + reason: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATA_BOX = "DataBox" + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + DATA_BOX_DISK = "DataBoxDisk" + DATA_BOX_HEAVY = "DataBoxHeavy" + + + class azure.mgmt.databox.models.CloudError(_Model): + additional_info: Optional[list[AdditionalErrorInfo]] + code: Optional[str] + details: Optional[list[CloudError]] + message: Optional[str] + target: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: Optional[str] = ..., + target: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ContactDetails(_Model): + contact_name: str + email_list: list[str] + mobile: Optional[str] + notification_preference: Optional[list[NotificationPreference]] + phone: str + phone_extension: Optional[str] + + @overload + def __init__( + self, + *, + contact_name: str, + email_list: list[str], + mobile: Optional[str] = ..., + notification_preference: Optional[list[NotificationPreference]] = ..., + phone: str, + phone_extension: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ContactInfo(_Model): + contact_name: str + mobile: Optional[str] + phone: str + phone_extension: Optional[str] + + @overload + def __init__( + self, + *, + contact_name: str, + mobile: Optional[str] = ..., + phone: str, + phone_extension: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.CopyLogDetails(_Model): + copy_log_details_type: str + + @overload + def __init__( + self, + *, + copy_log_details_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.CopyProgress(_Model): + account_id: Optional[str] + actions: Optional[list[Union[str, CustomerResolutionCode]]] + bytes_processed: Optional[int] + data_account_type: Optional[Union[str, DataAccountType]] + directories_errored_out: Optional[int] + error: Optional[CloudError] + files_errored_out: Optional[int] + files_processed: Optional[int] + invalid_directories_processed: Optional[int] + invalid_file_bytes_uploaded: Optional[int] + invalid_files_processed: Optional[int] + is_enumeration_in_progress: Optional[bool] + renamed_container_count: Optional[int] + storage_account_name: Optional[str] + total_bytes_to_process: Optional[int] + total_files_to_process: Optional[int] + transfer_type: Optional[Union[str, TransferType]] + + + class azure.mgmt.databox.models.CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "Completed" + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + DEVICE_FORMATTED = "DeviceFormatted" + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + DRIVE_CORRUPTED = "DriveCorrupted" + DRIVE_NOT_DETECTED = "DriveNotDetected" + DRIVE_NOT_RECEIVED = "DriveNotReceived" + FAILED = "Failed" + HARDWARE_ERROR = "HardwareError" + IN_PROGRESS = "InProgress" + METADATA_FILES_MODIFIED_OR_REMOVED = "MetadataFilesModifiedOrRemoved" + NOT_RETURNED = "NotReturned" + NOT_STARTED = "NotStarted" + OTHER_SERVICE_ERROR = "OtherServiceError" + OTHER_USER_ERROR = "OtherUserError" + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + UNSUPPORTED_DATA = "UnsupportedData" + UNSUPPORTED_DRIVE = "UnsupportedDrive" + + + class azure.mgmt.databox.models.CreateJobValidations(ValidationRequest, discriminator='JobCreationValidation'): + individual_request_details: list[ValidationInputRequest] + validation_category: str + + @overload + def __init__( + self, + *, + individual_request_details: list[ValidationInputRequest] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest, discriminator='ValidateCreateOrderLimit'): + device_type: Union[str, SkuName] + model: Optional[Union[str, ModelName]] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT] + + @overload + def __init__( + self, + *, + device_type: Union[str, SkuName], + model: Optional[Union[str, ModelName]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse, discriminator='ValidateCreateOrderLimit'): + error: CloudError + status: Optional[Union[str, ValidationStatus]] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.databox.models.CustomerDiskJobSecrets(JobSecrets, discriminator='DataBoxCustomerDisk'): + carrier_account_number: Optional[str] + dc_access_security_code: DcAccessSecurityCode + disk_secrets: Optional[list[DiskSecret]] + error: CloudError + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" + NONE = "None" + REACH_OUT_TO_OPERATION = "ReachOutToOperation" + RESTART = "Restart" + RESUME = "Resume" + + + class azure.mgmt.databox.models.DataAccountDetails(_Model): + data_account_type: str + share_password: Optional[str] + + @overload + def __init__( + self, + *, + data_account_type: str, + share_password: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED_DISK = "ManagedDisk" + STORAGE_ACCOUNT = "StorageAccount" + + + class azure.mgmt.databox.models.DataBoxAccountCopyLogDetails(CopyLogDetails, discriminator='DataBox'): + account_name: Optional[str] + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX] + copy_log_link: Optional[str] + copy_verbose_log_link: Optional[str] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxCustomerDiskCopyLogDetails(CopyLogDetails, discriminator='DataBoxCustomerDisk'): + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + error_log_link: Optional[str] + serial_number: Optional[str] + verbose_log_link: Optional[str] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxCustomerDiskCopyProgress(CopyProgress): + account_id: str + actions: Union[list[str, CustomerResolutionCode]] + bytes_processed: int + copy_status: Optional[Union[str, CopyStatus]] + data_account_type: Union[str, DataAccountType] + directories_errored_out: int + error: CloudError + files_errored_out: int + files_processed: int + invalid_directories_processed: int + invalid_file_bytes_uploaded: int + invalid_files_processed: int + is_enumeration_in_progress: bool + renamed_container_count: int + serial_number: Optional[str] + storage_account_name: str + total_bytes_to_process: int + total_files_to_process: int + transfer_type: Union[str, TransferType] + + + class azure.mgmt.databox.models.DataBoxCustomerDiskJobDetails(JobDetails, discriminator='DataBoxCustomerDisk'): + actions: Union[list[str, CustomerResolutionCode]] + chain_of_custody_sas_key: str + contact_details: ContactDetails + copy_log_details: list[CopyLogDetails] + copy_progress: Optional[list[DataBoxCustomerDiskCopyProgress]] + data_center_code: Union[str, DataCenterCode] + data_export_details: list[DataExportDetails] + data_import_details: list[DataImportDetails] + datacenter_address: DatacenterAddressResponse + deliver_to_dc_package_details: Optional[PackageCarrierInfo] + delivery_package: PackageShippingDetails + device_erasure_details: DeviceErasureDetails + enable_manifest_backup: Optional[bool] + expected_data_size_in_tera_bytes: int + export_disk_details_collection: Optional[dict[str, ExportDiskDetails]] + import_disk_details_collection: Optional[dict[str, ImportDiskDetails]] + job_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + job_stages: list[JobStages] + key_encryption_key: KeyEncryptionKey + last_mitigation_action_on_job: LastMitigationActionOnJob + preferences: Preferences + return_package: PackageShippingDetails + return_to_customer_package_details: PackageCarrierDetails + reverse_shipment_label_sas_key: str + reverse_shipping_details: ReverseShippingDetails + shipping_address: ShippingAddress + + @overload + def __init__( + self, + *, + contact_details: ContactDetails, + data_export_details: Optional[list[DataExportDetails]] = ..., + data_import_details: Optional[list[DataImportDetails]] = ..., + enable_manifest_backup: Optional[bool] = ..., + expected_data_size_in_tera_bytes: Optional[int] = ..., + import_disk_details_collection: Optional[dict[str, ImportDiskDetails]] = ..., + key_encryption_key: Optional[KeyEncryptionKey] = ..., + preferences: Optional[Preferences] = ..., + return_to_customer_package_details: PackageCarrierDetails, + reverse_shipping_details: Optional[ReverseShippingDetails] = ..., + shipping_address: Optional[ShippingAddress] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxDiskCopyLogDetails(CopyLogDetails, discriminator='DataBoxDisk'): + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_DISK] + disk_serial_number: Optional[str] + error_log_link: Optional[str] + verbose_log_link: Optional[str] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxDiskCopyProgress(_Model): + actions: Optional[list[Union[str, CustomerResolutionCode]]] + bytes_copied: Optional[int] + error: Optional[CloudError] + percent_complete: Optional[int] + serial_number: Optional[str] + status: Optional[Union[str, CopyStatus]] + + + class azure.mgmt.databox.models.DataBoxDiskGranularCopyLogDetails(GranularCopyLogDetails, discriminator='DataBoxCustomerDisk'): + account_id: Optional[str] + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + error_log_link: Optional[str] + serial_number: Optional[str] + verbose_log_link: Optional[str] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxDiskGranularCopyProgress(GranularCopyProgress): + account_id: str + actions: Union[list[str, CustomerResolutionCode]] + bytes_processed: int + copy_status: Optional[Union[str, CopyStatus]] + data_account_type: Union[str, DataAccountType] + directories_errored_out: int + error: CloudError + files_errored_out: int + files_processed: int + invalid_directories_processed: int + invalid_file_bytes_uploaded: int + invalid_files_processed: int + is_enumeration_in_progress: bool + renamed_container_count: int + serial_number: Optional[str] + storage_account_name: str + total_bytes_to_process: int + total_files_to_process: int + transfer_type: Union[str, TransferType] + + + class azure.mgmt.databox.models.DataBoxDiskJobDetails(JobDetails, discriminator='DataBoxDisk'): + actions: Union[list[str, CustomerResolutionCode]] + chain_of_custody_sas_key: str + contact_details: ContactDetails + copy_log_details: list[CopyLogDetails] + copy_progress: Optional[list[DataBoxDiskCopyProgress]] + data_center_code: Union[str, DataCenterCode] + data_export_details: list[DataExportDetails] + data_import_details: list[DataImportDetails] + datacenter_address: DatacenterAddressResponse + delivery_package: PackageShippingDetails + device_erasure_details: DeviceErasureDetails + disks_and_size_details: Optional[dict[str, int]] + expected_data_size_in_tera_bytes: int + granular_copy_log_details: Optional[list[DataBoxDiskGranularCopyLogDetails]] + granular_copy_progress: Optional[list[DataBoxDiskGranularCopyProgress]] + job_details_type: Literal[ClassDiscriminator.DATA_BOX_DISK] + job_stages: list[JobStages] + key_encryption_key: KeyEncryptionKey + last_mitigation_action_on_job: LastMitigationActionOnJob + passkey: Optional[str] + preferences: Preferences + preferred_disks: Optional[dict[str, int]] + return_package: PackageShippingDetails + reverse_shipment_label_sas_key: str + reverse_shipping_details: ReverseShippingDetails + shipping_address: ShippingAddress + + @overload + def __init__( + self, + *, + contact_details: ContactDetails, + data_export_details: Optional[list[DataExportDetails]] = ..., + data_import_details: Optional[list[DataImportDetails]] = ..., + expected_data_size_in_tera_bytes: Optional[int] = ..., + key_encryption_key: Optional[KeyEncryptionKey] = ..., + passkey: Optional[str] = ..., + preferences: Optional[Preferences] = ..., + preferred_disks: Optional[dict[str, int]] = ..., + reverse_shipping_details: Optional[ReverseShippingDetails] = ..., + shipping_address: Optional[ShippingAddress] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxDiskJobSecrets(JobSecrets, discriminator='DataBoxDisk'): + dc_access_security_code: DcAccessSecurityCode + disk_secrets: Optional[list[DiskSecret]] + error: CloudError + is_passkey_user_defined: Optional[bool] + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_DISK] + pass_key: Optional[str] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxHeavyAccountCopyLogDetails(CopyLogDetails, discriminator='DataBoxHeavy'): + account_name: Optional[str] + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] + copy_log_link: Optional[list[str]] + copy_verbose_log_link: Optional[list[str]] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxHeavyJobDetails(JobDetails, discriminator='DataBoxHeavy'): + actions: Union[list[str, CustomerResolutionCode]] + chain_of_custody_sas_key: str + contact_details: ContactDetails + copy_log_details: list[CopyLogDetails] + copy_progress: Optional[list[CopyProgress]] + data_center_code: Union[str, DataCenterCode] + data_export_details: list[DataExportDetails] + data_import_details: list[DataImportDetails] + datacenter_address: DatacenterAddressResponse + delivery_package: PackageShippingDetails + device_erasure_details: DeviceErasureDetails + device_password: Optional[str] + expected_data_size_in_tera_bytes: int + job_details_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] + job_stages: list[JobStages] + key_encryption_key: KeyEncryptionKey + last_mitigation_action_on_job: LastMitigationActionOnJob + preferences: Preferences + return_package: PackageShippingDetails + reverse_shipment_label_sas_key: str + reverse_shipping_details: ReverseShippingDetails + shipping_address: ShippingAddress + + @overload + def __init__( + self, + *, + contact_details: ContactDetails, + data_export_details: Optional[list[DataExportDetails]] = ..., + data_import_details: Optional[list[DataImportDetails]] = ..., + device_password: Optional[str] = ..., + expected_data_size_in_tera_bytes: Optional[int] = ..., + key_encryption_key: Optional[KeyEncryptionKey] = ..., + preferences: Optional[Preferences] = ..., + reverse_shipping_details: Optional[ReverseShippingDetails] = ..., + shipping_address: Optional[ShippingAddress] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxHeavyJobSecrets(JobSecrets, discriminator='DataBoxHeavy'): + cabinet_pod_secrets: Optional[list[DataBoxHeavySecret]] + dc_access_security_code: DcAccessSecurityCode + error: CloudError + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxHeavySecret(_Model): + account_credential_details: Optional[list[AccountCredentialDetails]] + device_password: Optional[str] + device_serial_number: Optional[str] + encoded_validation_cert_pub_key: Optional[str] + network_configurations: Optional[list[ApplianceNetworkConfiguration]] + + + class azure.mgmt.databox.models.DataBoxJobDetails(JobDetails, discriminator='DataBox'): + actions: Union[list[str, CustomerResolutionCode]] + chain_of_custody_sas_key: str + contact_details: ContactDetails + copy_log_details: list[CopyLogDetails] + copy_progress: Optional[list[CopyProgress]] + data_center_code: Union[str, DataCenterCode] + data_export_details: list[DataExportDetails] + data_import_details: list[DataImportDetails] + datacenter_address: DatacenterAddressResponse + delivery_package: PackageShippingDetails + device_erasure_details: DeviceErasureDetails + device_password: Optional[str] + expected_data_size_in_tera_bytes: int + job_details_type: Literal[ClassDiscriminator.DATA_BOX] + job_stages: list[JobStages] + key_encryption_key: KeyEncryptionKey + last_mitigation_action_on_job: LastMitigationActionOnJob + preferences: Preferences + return_package: PackageShippingDetails + reverse_shipment_label_sas_key: str + reverse_shipping_details: ReverseShippingDetails + shipping_address: ShippingAddress + + @overload + def __init__( + self, + *, + contact_details: ContactDetails, + data_export_details: Optional[list[DataExportDetails]] = ..., + data_import_details: Optional[list[DataImportDetails]] = ..., + device_password: Optional[str] = ..., + expected_data_size_in_tera_bytes: Optional[int] = ..., + key_encryption_key: Optional[KeyEncryptionKey] = ..., + preferences: Optional[Preferences] = ..., + reverse_shipping_details: Optional[ReverseShippingDetails] = ..., + shipping_address: Optional[ShippingAddress] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest, discriminator='DataBox'): + country: str + model: Union[str, ModelName] + sku_name: Literal[SkuName.DATA_BOX] + storage_location: str + + @overload + def __init__( + self, + *, + country: Optional[str] = ..., + model: Optional[Union[str, ModelName]] = ..., + storage_location: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataBoxSecret(_Model): + account_credential_details: Optional[list[AccountCredentialDetails]] + device_password: Optional[str] + device_serial_number: Optional[str] + encoded_validation_cert_pub_key: Optional[str] + network_configurations: Optional[list[ApplianceNetworkConfiguration]] + + + class azure.mgmt.databox.models.DataCenterCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AD_HOC = "AdHoc" + AM2 = "AM2" + AMS06 = "AMS06" + AMS20 = "AMS20" + AMS25 = "AMS25" + AUH20 = "AUH20" + BJB = "BJB" + BJS20 = "BJS20" + BL20 = "BL20" + BL24 = "BL24" + BL7 = "BL7" + BN1 = "BN1" + BN7 = "BN7" + BOM01 = "BOM01" + BY1 = "BY1" + BY2 = "BY2" + BY21 = "BY21" + BY24 = "BY24" + CBR20 = "CBR20" + CH1 = "CH1" + CPQ02 = "CPQ02" + CPQ20 = "CPQ20" + CPQ21 = "CPQ21" + CWL20 = "CWL20" + CYS04 = "CYS04" + DSM05 = "DSM05" + DSM11 = "DSM11" + DUB07 = "DUB07" + DXB23 = "DXB23" + FRA22 = "FRA22" + HKG20 = "HKG20" + IDC5 = "IDC5" + INVALID = "Invalid" + JNB21 = "JNB21" + JNB22 = "JNB22" + LON24 = "LON24" + MAA01 = "MAA01" + MEL23 = "MEL23" + MNZ21 = "MNZ21" + MWH01 = "MWH01" + NTG20 = "NTG20" + ORK70 = "ORK70" + OSA02 = "OSA02" + OSA20 = "OSA20" + OSA22 = "OSA22" + OSA23 = "OSA23" + PAR22 = "PAR22" + PNQ01 = "PNQ01" + PUS20 = "PUS20" + SEL20 = "SEL20" + SEL21 = "SEL21" + SG2 = "SG2" + SHA03 = "SHA03" + SIN20 = "SIN20" + SN5 = "SN5" + SN6 = "SN6" + SN8 = "SN8" + SSE90 = "SSE90" + SVG20 = "SVG20" + SYD03 = "SYD03" + SYD23 = "SYD23" + TYO01 = "TYO01" + TYO22 = "TYO22" + TYO23 = "TYO23" + YQB20 = "YQB20" + YTO20 = "YTO20" + YTO21 = "YTO21" + ZRH20 = "ZRH20" + + + class azure.mgmt.databox.models.DataExportDetails(_Model): + account_details: DataAccountDetails + log_collection_level: Optional[Union[str, LogCollectionLevel]] + transfer_configuration: TransferConfiguration + + @overload + def __init__( + self, + *, + account_details: DataAccountDetails, + log_collection_level: Optional[Union[str, LogCollectionLevel]] = ..., + transfer_configuration: TransferConfiguration + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataImportDetails(_Model): + account_details: DataAccountDetails + log_collection_level: Optional[Union[str, LogCollectionLevel]] + + @overload + def __init__( + self, + *, + account_details: DataAccountDetails, + log_collection_level: Optional[Union[str, LogCollectionLevel]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataLocationToServiceLocationMap(_Model): + data_location: Optional[str] + service_location: Optional[str] + + + class azure.mgmt.databox.models.DataTransferDetailsValidationRequest(ValidationInputRequest, discriminator='ValidateDataTransferDetails'): + data_export_details: Optional[list[DataExportDetails]] + data_import_details: Optional[list[DataImportDetails]] + device_type: Union[str, SkuName] + model: Optional[Union[str, ModelName]] + transfer_type: Union[str, TransferType] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS] + + @overload + def __init__( + self, + *, + data_export_details: Optional[list[DataExportDetails]] = ..., + data_import_details: Optional[list[DataImportDetails]] = ..., + device_type: Union[str, SkuName], + model: Optional[Union[str, ModelName]] = ..., + transfer_type: Union[str, TransferType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataTransferDetailsValidationResponseProperties(ValidationInputResponse, discriminator='ValidateDataTransferDetails'): + error: CloudError + status: Optional[Union[str, ValidationStatus]] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DataboxJobSecrets(JobSecrets, discriminator='DataBox'): + dc_access_security_code: DcAccessSecurityCode + error: CloudError + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX] + pod_secrets: Optional[list[DataBoxSecret]] + + @overload + def __init__( + self, + *, + pod_secrets: Optional[list[DataBoxSecret]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DatacenterAddressInstructionResponse(DatacenterAddressResponse, discriminator='DatacenterAddressInstruction'): + communication_instruction: Optional[str] + data_center_azure_location: str + datacenter_address_type: Literal[DatacenterAddressType.DATACENTER_ADDRESS_INSTRUCTION] + supported_carriers_for_return_shipment: list[str] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DatacenterAddressLocationResponse(DatacenterAddressResponse, discriminator='DatacenterAddressLocation'): + additional_shipping_information: Optional[str] + address_type: Optional[str] + city: Optional[str] + company: Optional[str] + contact_person_name: Optional[str] + country: Optional[str] + data_center_azure_location: str + datacenter_address_type: Literal[DatacenterAddressType.DATACENTER_ADDRESS_LOCATION] + phone: Optional[str] + phone_extension: Optional[str] + state: Optional[str] + street1: Optional[str] + street2: Optional[str] + street3: Optional[str] + supported_carriers_for_return_shipment: list[str] + zip: Optional[str] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DatacenterAddressRequest(_Model): + model: Optional[Union[str, ModelName]] + sku_name: Union[str, SkuName] + storage_location: str + + @overload + def __init__( + self, + *, + model: Optional[Union[str, ModelName]] = ..., + sku_name: Union[str, SkuName], + storage_location: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DatacenterAddressResponse(_Model): + data_center_azure_location: Optional[str] + datacenter_address_type: str + supported_carriers_for_return_shipment: Optional[list[str]] + + @overload + def __init__( + self, + *, + datacenter_address_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DatacenterAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATACENTER_ADDRESS_INSTRUCTION = "DatacenterAddressInstruction" + DATACENTER_ADDRESS_LOCATION = "DatacenterAddressLocation" + + + class azure.mgmt.databox.models.DcAccessSecurityCode(_Model): + forward_dc_access_code: Optional[str] + reverse_dc_access_code: Optional[str] + + @overload + def __init__( + self, + *, + forward_dc_access_code: Optional[str] = ..., + reverse_dc_access_code: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DelayNotificationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "Active" + RESOLVED = "Resolved" + + + class azure.mgmt.databox.models.Details(_Model): + code: str + message: str + + @overload + def __init__( + self, + *, + code: str, + message: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DeviceCapabilityDetails(_Model): + hardware_encryption: Optional[Union[str, HardwareEncryption]] + + + class azure.mgmt.databox.models.DeviceCapabilityRequest(_Model): + model: Optional[Union[str, ModelName]] + sku_name: Optional[Union[str, SkuName]] + + @overload + def __init__( + self, + *, + model: Optional[Union[str, ModelName]] = ..., + sku_name: Optional[Union[str, SkuName]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DeviceCapabilityResponse(_Model): + device_capability_details: Optional[list[DeviceCapabilityDetails]] + + + class azure.mgmt.databox.models.DeviceErasureDetails(_Model): + device_erasure_status: Optional[Union[str, StageStatus]] + erasure_or_destruction_certificate_sas_key: Optional[str] + secure_erasure_certificate_sas_key: Optional[str] + + + class azure.mgmt.databox.models.DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest, discriminator='DataBoxDisk'): + country: str + expected_data_size_in_tera_bytes: int + model: Union[str, ModelName] + sku_name: Literal[SkuName.DATA_BOX_DISK] + storage_location: str + + @overload + def __init__( + self, + *, + country: Optional[str] = ..., + expected_data_size_in_tera_bytes: int, + model: Optional[Union[str, ModelName]] = ..., + storage_location: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.DiskSecret(_Model): + bit_locker_key: Optional[str] + disk_serial_number: Optional[str] + + + class azure.mgmt.databox.models.DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.databox.models.EncryptionPreferences(_Model): + double_encryption: Optional[Union[str, DoubleEncryption]] + hardware_encryption: Optional[Union[str, HardwareEncryption]] + + @overload + def __init__( + self, + *, + double_encryption: Optional[Union[str, DoubleEncryption]] = ..., + hardware_encryption: Optional[Union[str, HardwareEncryption]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ErrorDetail(_Model): + code: str + details: Optional[list[Details]] + message: str + target: Optional[str] + + @overload + def __init__( + self, + *, + code: str, + details: Optional[list[Details]] = ..., + message: str, + target: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ExportDiskDetails(_Model): + backup_manifest_cloud_path: Optional[str] + manifest_file: Optional[str] + manifest_hash: Optional[str] + + + class azure.mgmt.databox.models.FilterFileDetails(_Model): + filter_file_path: str + filter_file_type: Union[str, FilterFileType] + + @overload + def __init__( + self, + *, + filter_file_path: str, + filter_file_type: Union[str, FilterFileType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_BLOB = "AzureBlob" + AZURE_FILE = "AzureFile" + + + class azure.mgmt.databox.models.GranularCopyLogDetails(_Model): + copy_log_details_type: str + + @overload + def __init__( + self, + *, + copy_log_details_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.GranularCopyProgress(_Model): + account_id: Optional[str] + actions: Optional[list[Union[str, CustomerResolutionCode]]] + bytes_processed: Optional[int] + data_account_type: Optional[Union[str, DataAccountType]] + directories_errored_out: Optional[int] + error: Optional[CloudError] + files_errored_out: Optional[int] + files_processed: Optional[int] + invalid_directories_processed: Optional[int] + invalid_file_bytes_uploaded: Optional[int] + invalid_files_processed: Optional[int] + is_enumeration_in_progress: Optional[bool] + renamed_container_count: Optional[int] + storage_account_name: Optional[str] + total_bytes_to_process: Optional[int] + total_files_to_process: Optional[int] + transfer_type: Optional[Union[str, TransferType]] + + + class azure.mgmt.databox.models.HardwareEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.databox.models.HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest, discriminator='DataBoxHeavy'): + country: str + model: Union[str, ModelName] + sku_name: Literal[SkuName.DATA_BOX_HEAVY] + storage_location: str + + @overload + def __init__( + self, + *, + country: Optional[str] = ..., + model: Optional[Union[str, ModelName]] = ..., + storage_location: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.IdentityProperties(_Model): + type: Optional[str] + user_assigned: Optional[UserAssignedProperties] + + @overload + def __init__( + self, + *, + type: Optional[str] = ..., + user_assigned: Optional[UserAssignedProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ImportDiskDetails(_Model): + backup_manifest_cloud_path: Optional[str] + bit_locker_key: str + manifest_file: str + manifest_hash: str + + @overload + def __init__( + self, + *, + bit_locker_key: str, + manifest_file: str, + manifest_hash: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.JobDelayDetails(_Model): + description: Optional[str] + error_code: Optional[Union[str, PortalDelayErrorCode]] + resolution_time: Optional[datetime] + start_time: Optional[datetime] + status: Optional[Union[str, DelayNotificationStatus]] + + + class azure.mgmt.databox.models.JobDeliveryInfo(_Model): + scheduled_date_time: Optional[datetime] + + @overload + def __init__( + self, + *, + scheduled_date_time: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NON_SCHEDULED = "NonScheduled" + SCHEDULED = "Scheduled" + + + class azure.mgmt.databox.models.JobDetails(_Model): + actions: Optional[list[Union[str, CustomerResolutionCode]]] + chain_of_custody_sas_key: Optional[str] + contact_details: ContactDetails + copy_log_details: Optional[list[CopyLogDetails]] + data_center_code: Optional[Union[str, DataCenterCode]] + data_export_details: Optional[list[DataExportDetails]] + data_import_details: Optional[list[DataImportDetails]] + datacenter_address: Optional[DatacenterAddressResponse] + delivery_package: Optional[PackageShippingDetails] + device_erasure_details: Optional[DeviceErasureDetails] + expected_data_size_in_tera_bytes: Optional[int] + job_details_type: str + job_stages: Optional[list[JobStages]] + key_encryption_key: Optional[KeyEncryptionKey] + last_mitigation_action_on_job: Optional[LastMitigationActionOnJob] + preferences: Optional[Preferences] + return_package: Optional[PackageShippingDetails] + reverse_shipment_label_sas_key: Optional[str] + reverse_shipping_details: Optional[ReverseShippingDetails] + shipping_address: Optional[ShippingAddress] + + @overload + def __init__( + self, + *, + contact_details: ContactDetails, + data_export_details: Optional[list[DataExportDetails]] = ..., + data_import_details: Optional[list[DataImportDetails]] = ..., + expected_data_size_in_tera_bytes: Optional[int] = ..., + job_details_type: str, + key_encryption_key: Optional[KeyEncryptionKey] = ..., + preferences: Optional[Preferences] = ..., + reverse_shipping_details: Optional[ReverseShippingDetails] = ..., + shipping_address: Optional[ShippingAddress] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.JobProperties(_Model): + all_devices_lost: Optional[bool] + cancellation_reason: Optional[str] + delayed_stage: Optional[Union[str, StageName]] + delivery_info: Optional[JobDeliveryInfo] + delivery_type: Optional[Union[str, JobDeliveryType]] + details: Optional[JobDetails] + error: Optional[CloudError] + is_cancellable: Optional[bool] + is_cancellable_without_fee: Optional[bool] + is_deletable: Optional[bool] + is_prepare_to_ship_enabled: Optional[bool] + is_shipping_address_editable: Optional[bool] + reverse_shipping_details_update: Optional[Union[str, ReverseShippingDetailsEditStatus]] + reverse_transport_preference_update: Optional[Union[str, ReverseTransportPreferenceEditStatus]] + start_time: Optional[datetime] + status: Optional[Union[str, StageName]] + transfer_type: Union[str, TransferType] + + @overload + def __init__( + self, + *, + delivery_info: Optional[JobDeliveryInfo] = ..., + delivery_type: Optional[Union[str, JobDeliveryType]] = ..., + details: Optional[JobDetails] = ..., + transfer_type: Union[str, TransferType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.JobResource(TrackedResource): + id: str + identity: Optional[ResourceIdentity] + location: str + name: str + properties: JobProperties + sku: Sku + system_data: SystemData + tags: dict[str, str] + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + identity: Optional[ResourceIdentity] = ..., + location: str, + properties: JobProperties, + sku: Sku, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.databox.models.JobResourceUpdateParameter(_Model): + identity: Optional[ResourceIdentity] + properties: Optional[UpdateJobProperties] + tags: Optional[dict[str, str]] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + identity: Optional[ResourceIdentity] = ..., + properties: Optional[UpdateJobProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.databox.models.JobSecrets(_Model): + dc_access_security_code: Optional[DcAccessSecurityCode] + error: Optional[CloudError] + job_secrets_type: str + + @overload + def __init__( + self, + *, + job_secrets_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.JobStages(_Model): + delay_information: Optional[list[JobDelayDetails]] + display_name: Optional[str] + job_stage_details: Optional[Any] + stage_name: Optional[Union[str, StageName]] + stage_status: Optional[Union[str, StageStatus]] + stage_time: Optional[datetime] + + + class azure.mgmt.databox.models.KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOMER_MANAGED = "CustomerManaged" + MICROSOFT_MANAGED = "MicrosoftManaged" + + + class azure.mgmt.databox.models.KeyEncryptionKey(_Model): + identity_properties: Optional[IdentityProperties] + kek_type: Union[str, KekType] + kek_url: Optional[str] + kek_vault_resource_id: Optional[str] + + @overload + def __init__( + self, + *, + identity_properties: Optional[IdentityProperties] = ..., + kek_type: Union[str, KekType], + kek_url: Optional[str] = ..., + kek_vault_resource_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.LastMitigationActionOnJob(_Model): + action_date_time_in_utc: Optional[datetime] + customer_resolution: Optional[Union[str, CustomerResolutionCode]] + is_performed_by_customer: Optional[bool] + + @overload + def __init__( + self, + *, + action_date_time_in_utc: Optional[datetime] = ..., + customer_resolution: Optional[Union[str, CustomerResolutionCode]] = ..., + is_performed_by_customer: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ERROR = "Error" + VERBOSE = "Verbose" + + + class azure.mgmt.databox.models.ManagedDiskDetails(DataAccountDetails, discriminator='ManagedDisk'): + data_account_type: Literal[DataAccountType.MANAGED_DISK] + resource_group_id: str + share_password: str + staging_storage_account_id: str + + @overload + def __init__( + self, + *, + resource_group_id: str, + share_password: Optional[str] = ..., + staging_storage_account_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.MarkDevicesShippedRequest(_Model): + deliver_to_dc_package_details: PackageCarrierInfo + + @overload + def __init__( + self, + *, + deliver_to_dc_package_details: PackageCarrierInfo + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.MitigateJobRequest(_Model): + customer_resolution_code: Optional[Union[str, CustomerResolutionCode]] + serial_number_customer_resolution_map: Optional[dict[str, Union[str, CustomerResolutionCode]]] + + @overload + def __init__( + self, + *, + customer_resolution_code: Optional[Union[str, CustomerResolutionCode]] = ..., + serial_number_customer_resolution_map: Optional[dict[str, Union[str, CustomerResolutionCode]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ModelName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_DATA_BOX120 = "AzureDataBox120" + AZURE_DATA_BOX525 = "AzureDataBox525" + DATA_BOX = "DataBox" + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + DATA_BOX_DISK = "DataBoxDisk" + DATA_BOX_HEAVY = "DataBoxHeavy" + + + class azure.mgmt.databox.models.NotificationPreference(_Model): + send_notification: bool + stage_name: Union[str, NotificationStageName] + + @overload + def __init__( + self, + *, + send_notification: bool, + stage_name: Union[str, NotificationStageName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AT_AZURE_DC = "AtAzureDC" + CREATED = "Created" + DATA_COPY = "DataCopy" + DELIVERED = "Delivered" + DEVICE_PREPARED = "DevicePrepared" + DISPATCHED = "Dispatched" + PICKED_UP = "PickedUp" + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + + + class azure.mgmt.databox.models.Operation(_Model): + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[str] + properties: Optional[OperationProperties] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + is_data_action: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.databox.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + operation: Optional[str] = ..., + provider: Optional[str] = ..., + resource: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.OperationProperties(_Model): + + + class azure.mgmt.databox.models.OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALL_VALID_TO_PROCEED = "AllValidToProceed" + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + + + class azure.mgmt.databox.models.PackageCarrierDetails(_Model): + carrier_account_number: Optional[str] + carrier_name: Optional[str] + tracking_id: Optional[str] + + @overload + def __init__( + self, + *, + carrier_account_number: Optional[str] = ..., + carrier_name: Optional[str] = ..., + tracking_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.PackageCarrierInfo(_Model): + carrier_name: Optional[str] + tracking_id: Optional[str] + + @overload + def __init__( + self, + *, + carrier_name: Optional[str] = ..., + tracking_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.PackageShippingDetails(_Model): + carrier_name: Optional[str] + tracking_id: Optional[str] + tracking_url: Optional[str] + + + class azure.mgmt.databox.models.PortalDelayErrorCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE_ORDER_LIMIT_BREACHED_DELAY = "ActiveOrderLimitBreachedDelay" + HIGH_DEMAND_DELAY = "HighDemandDelay" + INTERNAL_ISSUE_DELAY = "InternalIssueDelay" + LARGE_NUMBER_OF_FILES_DELAY = "LargeNumberOfFilesDelay" + + + class azure.mgmt.databox.models.Preferences(_Model): + encryption_preferences: Optional[EncryptionPreferences] + preferred_data_center_region: Optional[list[str]] + reverse_transport_preferences: Optional[TransportPreferences] + storage_account_access_tier_preferences: Optional[list[Literal["Archive"]]] + transport_preferences: Optional[TransportPreferences] + + @overload + def __init__( + self, + *, + encryption_preferences: Optional[EncryptionPreferences] = ..., + preferred_data_center_region: Optional[list[str]] = ..., + reverse_transport_preferences: Optional[TransportPreferences] = ..., + storage_account_access_tier_preferences: Optional[list[Literal[Archive]]] = ..., + transport_preferences: Optional[TransportPreferences] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.PreferencesValidationRequest(ValidationInputRequest, discriminator='ValidatePreferences'): + device_type: Union[str, SkuName] + model: Optional[Union[str, ModelName]] + preference: Optional[Preferences] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES] + + @overload + def __init__( + self, + *, + device_type: Union[str, SkuName], + model: Optional[Union[str, ModelName]] = ..., + preference: Optional[Preferences] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.PreferencesValidationResponseProperties(ValidationInputResponse, discriminator='ValidatePreferences'): + error: CloudError + status: Optional[Union[str, ValidationStatus]] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.RegionConfigurationRequest(_Model): + datacenter_address_request: Optional[DatacenterAddressRequest] + device_capability_request: Optional[DeviceCapabilityRequest] + schedule_availability_request: Optional[ScheduleAvailabilityRequest] + transport_availability_request: Optional[TransportAvailabilityRequest] + + @overload + def __init__( + self, + *, + datacenter_address_request: Optional[DatacenterAddressRequest] = ..., + device_capability_request: Optional[DeviceCapabilityRequest] = ..., + schedule_availability_request: Optional[ScheduleAvailabilityRequest] = ..., + transport_availability_request: Optional[TransportAvailabilityRequest] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.RegionConfigurationResponse(_Model): + datacenter_address_response: Optional[DatacenterAddressResponse] + device_capability_response: Optional[DeviceCapabilityResponse] + schedule_availability_response: Optional[ScheduleAvailabilityResponse] + transport_availability_response: Optional[TransportAvailabilityResponse] + + + class azure.mgmt.databox.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.databox.models.ResourceIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Optional[str] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + + @overload + def __init__( + self, + *, + type: Optional[str] = ..., + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ReverseShippingDetails(_Model): + contact_details: Optional[ContactInfo] + is_updated: Optional[bool] + shipping_address: Optional[ShippingAddress] + + @overload + def __init__( + self, + *, + contact_details: Optional[ContactInfo] = ..., + shipping_address: Optional[ShippingAddress] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ReverseShippingDetailsEditStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + NOT_SUPPORTED = "NotSupported" + + + class azure.mgmt.databox.models.ReverseTransportPreferenceEditStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + NOT_SUPPORTED = "NotSupported" + + + class azure.mgmt.databox.models.ScheduleAvailabilityRequest(_Model): + country: Optional[str] + model: Optional[Union[str, ModelName]] + sku_name: str + storage_location: str + + @overload + def __init__( + self, + *, + country: Optional[str] = ..., + model: Optional[Union[str, ModelName]] = ..., + sku_name: str, + storage_location: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ScheduleAvailabilityResponse(_Model): + available_dates: Optional[list[datetime]] + + + class azure.mgmt.databox.models.ShareCredentialDetails(_Model): + password: Optional[str] + share_name: Optional[str] + share_type: Optional[Union[str, ShareDestinationFormatType]] + supported_access_protocols: Optional[list[Union[str, AccessProtocol]]] + user_name: Optional[str] + + + class azure.mgmt.databox.models.ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_FILE = "AzureFile" + BLOCK_BLOB = "BlockBlob" + HCS = "HCS" + MANAGED_DISK = "ManagedDisk" + PAGE_BLOB = "PageBlob" + UNKNOWN_TYPE = "UnknownType" + + + class azure.mgmt.databox.models.ShipmentPickUpRequest(_Model): + end_time: datetime + shipment_location: str + start_time: datetime + + @overload + def __init__( + self, + *, + end_time: datetime, + shipment_location: str, + start_time: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ShipmentPickUpResponse(_Model): + confirmation_number: Optional[str] + ready_by_time: Optional[datetime] + + + class azure.mgmt.databox.models.ShippingAddress(_Model): + address_type: Optional[Union[str, AddressType]] + city: Optional[str] + company_name: Optional[str] + country: str + postal_code: Optional[str] + skip_address_validation: Optional[bool] + state_or_province: Optional[str] + street_address1: str + street_address2: Optional[str] + street_address3: Optional[str] + tax_identification_number: Optional[str] + zip_extended_code: Optional[str] + + @overload + def __init__( + self, + *, + address_type: Optional[Union[str, AddressType]] = ..., + city: Optional[str] = ..., + company_name: Optional[str] = ..., + country: str, + postal_code: Optional[str] = ..., + skip_address_validation: Optional[bool] = ..., + state_or_province: Optional[str] = ..., + street_address1: str, + street_address2: Optional[str] = ..., + street_address3: Optional[str] = ..., + tax_identification_number: Optional[str] = ..., + zip_extended_code: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.Sku(_Model): + display_name: Optional[str] + family: Optional[str] + model: Optional[Union[str, ModelName]] + name: Union[str, SkuName] + + @overload + def __init__( + self, + *, + display_name: Optional[str] = ..., + family: Optional[str] = ..., + model: Optional[Union[str, ModelName]] = ..., + name: Union[str, SkuName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.SkuAvailabilityValidationRequest(ValidationInputRequest, discriminator='ValidateSkuAvailability'): + country: str + device_type: Union[str, SkuName] + location: str + model: Optional[Union[str, ModelName]] + transfer_type: Union[str, TransferType] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY] + + @overload + def __init__( + self, + *, + country: str, + device_type: Union[str, SkuName], + location: str, + model: Optional[Union[str, ModelName]] = ..., + transfer_type: Union[str, TransferType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.SkuAvailabilityValidationResponseProperties(ValidationInputResponse, discriminator='ValidateSkuAvailability'): + error: CloudError + status: Optional[Union[str, ValidationStatus]] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.SkuCapacity(_Model): + individual_sku_usable: Optional[str] + maximum: Optional[str] + usable: Optional[str] + + + class azure.mgmt.databox.models.SkuCost(_Model): + meter_id: Optional[str] + meter_type: Optional[str] + multiplier: Optional[float] + + + class azure.mgmt.databox.models.SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COUNTRY = "Country" + FEATURE = "Feature" + NONE = "None" + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + OFFER_TYPE = "OfferType" + REGION = "Region" + + + class azure.mgmt.databox.models.SkuInformation(_Model): + enabled: Optional[bool] + properties: Optional[SkuProperties] + sku: Optional[Sku] + + + class azure.mgmt.databox.models.SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATA_BOX = "DataBox" + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + DATA_BOX_DISK = "DataBoxDisk" + DATA_BOX_HEAVY = "DataBoxHeavy" + + + class azure.mgmt.databox.models.SkuProperties(_Model): + api_versions: Optional[list[str]] + capacity: Optional[SkuCapacity] + costs: Optional[list[SkuCost]] + countries_within_commerce_boundary: Optional[list[str]] + data_location_to_service_location_map: Optional[list[DataLocationToServiceLocationMap]] + disabled_reason: Optional[Union[str, SkuDisabledReason]] + disabled_reason_message: Optional[str] + required_feature: Optional[str] + + + class azure.mgmt.databox.models.StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ABORTED = "Aborted" + AT_AZURE_DC = "AtAzureDC" + AWAITING_SHIPMENT_DETAILS = "AwaitingShipmentDetails" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + CREATED = "Created" + DATA_COPY = "DataCopy" + DELIVERED = "Delivered" + DEVICE_ORDERED = "DeviceOrdered" + DEVICE_PREPARED = "DevicePrepared" + DISPATCHED = "Dispatched" + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + PICKED_UP = "PickedUp" + PREPARING_TO_SHIP_FROM_AZURE_DC = "PreparingToShipFromAzureDC" + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + SHIPPED_TO_AZURE_DC = "ShippedToAzureDC" + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + + + class azure.mgmt.databox.models.StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "Cancelled" + CANCELLING = "Cancelling" + CUSTOMER_ACTION_PERFORMED = "CustomerActionPerformed" + CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + NONE = "None" + SUCCEEDED = "Succeeded" + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" + WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" + + + class azure.mgmt.databox.models.StorageAccountDetails(DataAccountDetails, discriminator='StorageAccount'): + data_account_type: Literal[DataAccountType.STORAGE_ACCOUNT] + share_password: str + storage_account_id: str + + @overload + def __init__( + self, + *, + share_password: Optional[str] = ..., + storage_account_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest, discriminator='ValidateSubscriptionIsAllowedToCreateJob'): + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse, discriminator='ValidateSubscriptionIsAllowedToCreateJob'): + error: CloudError + status: Optional[Union[str, ValidationStatus]] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.TransferAllDetails(_Model): + data_account_type: Union[str, DataAccountType] + transfer_all_blobs: Optional[bool] + transfer_all_files: Optional[bool] + + @overload + def __init__( + self, + *, + data_account_type: Union[str, DataAccountType], + transfer_all_blobs: Optional[bool] = ..., + transfer_all_files: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.TransferConfiguration(_Model): + transfer_all_details: Optional[TransferConfigurationTransferAllDetails] + transfer_configuration_type: Union[str, TransferConfigurationType] + transfer_filter_details: Optional[TransferConfigurationTransferFilterDetails] + + @overload + def __init__( + self, + *, + transfer_all_details: Optional[TransferConfigurationTransferAllDetails] = ..., + transfer_configuration_type: Union[str, TransferConfigurationType], + transfer_filter_details: Optional[TransferConfigurationTransferFilterDetails] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.TransferConfigurationTransferAllDetails(_Model): + include: Optional[TransferAllDetails] + + @overload + def __init__( + self, + *, + include: Optional[TransferAllDetails] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails(_Model): + include: Optional[TransferFilterDetails] + + @overload + def __init__( + self, + *, + include: Optional[TransferFilterDetails] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + TRANSFER_ALL = "TransferAll" + TRANSFER_USING_FILTER = "TransferUsingFilter" + + + class azure.mgmt.databox.models.TransferFilterDetails(_Model): + azure_file_filter_details: Optional[AzureFileFilterDetails] + blob_filter_details: Optional[BlobFilterDetails] + data_account_type: Union[str, DataAccountType] + filter_file_details: Optional[list[FilterFileDetails]] + + @overload + def __init__( + self, + *, + azure_file_filter_details: Optional[AzureFileFilterDetails] = ..., + blob_filter_details: Optional[BlobFilterDetails] = ..., + data_account_type: Union[str, DataAccountType], + filter_file_details: Optional[list[FilterFileDetails]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXPORT_FROM_AZURE = "ExportFromAzure" + IMPORT_TO_AZURE = "ImportToAzure" + + + class azure.mgmt.databox.models.TransportAvailabilityDetails(_Model): + shipment_type: Optional[Union[str, TransportShipmentTypes]] + + + class azure.mgmt.databox.models.TransportAvailabilityRequest(_Model): + model: Optional[Union[str, ModelName]] + sku_name: Optional[Union[str, SkuName]] + + @overload + def __init__( + self, + *, + model: Optional[Union[str, ModelName]] = ..., + sku_name: Optional[Union[str, SkuName]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.TransportAvailabilityResponse(_Model): + transport_availability_details: Optional[list[TransportAvailabilityDetails]] + + + class azure.mgmt.databox.models.TransportPreferences(_Model): + is_updated: Optional[bool] + preferred_shipment_type: Union[str, TransportShipmentTypes] + + @overload + def __init__( + self, + *, + preferred_shipment_type: Union[str, TransportShipmentTypes] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOMER_MANAGED = "CustomerManaged" + MICROSOFT_MANAGED = "MicrosoftManaged" + + + class azure.mgmt.databox.models.UnencryptedCredentials(_Model): + job_name: Optional[str] + job_secrets: Optional[JobSecrets] + + + class azure.mgmt.databox.models.UpdateJobDetails(_Model): + contact_details: Optional[ContactDetails] + key_encryption_key: Optional[KeyEncryptionKey] + preferences: Optional[Preferences] + return_to_customer_package_details: Optional[PackageCarrierDetails] + reverse_shipping_details: Optional[ReverseShippingDetails] + shipping_address: Optional[ShippingAddress] + + @overload + def __init__( + self, + *, + contact_details: Optional[ContactDetails] = ..., + key_encryption_key: Optional[KeyEncryptionKey] = ..., + preferences: Optional[Preferences] = ..., + return_to_customer_package_details: Optional[PackageCarrierDetails] = ..., + reverse_shipping_details: Optional[ReverseShippingDetails] = ..., + shipping_address: Optional[ShippingAddress] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.UpdateJobProperties(_Model): + details: Optional[UpdateJobDetails] + + @overload + def __init__( + self, + *, + details: Optional[UpdateJobDetails] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] + + + class azure.mgmt.databox.models.UserAssignedProperties(_Model): + resource_id: Optional[str] + + @overload + def __init__( + self, + *, + resource_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ValidateAddress(ValidationInputRequest, discriminator='ValidateAddress'): + device_type: Union[str, SkuName] + model: Optional[Union[str, ModelName]] + shipping_address: ShippingAddress + transport_preferences: Optional[TransportPreferences] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS] + + @overload + def __init__( + self, + *, + device_type: Union[str, SkuName], + model: Optional[Union[str, ModelName]] = ..., + shipping_address: ShippingAddress, + transport_preferences: Optional[TransportPreferences] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + VALIDATE_ADDRESS = "ValidateAddress" + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + VALIDATE_PREFERENCES = "ValidatePreferences" + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + + + class azure.mgmt.databox.models.ValidationInputRequest(_Model): + validation_type: str + + @overload + def __init__( + self, + *, + validation_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ValidationInputResponse(_Model): + error: Optional[CloudError] + validation_type: str + + @overload + def __init__( + self, + *, + validation_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ValidationRequest(_Model): + individual_request_details: list[ValidationInputRequest] + validation_category: Literal["JobCreationValidation"] + + @overload + def __init__( + self, + *, + individual_request_details: list[ValidationInputRequest] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.databox.models.ValidationResponse(_Model): + properties: Optional[ValidationResponseProperties] + + + class azure.mgmt.databox.models.ValidationResponseProperties(_Model): + individual_response_details: Optional[list[ValidationInputResponse]] + status: Optional[Union[str, OverallValidationStatus]] + + + class azure.mgmt.databox.models.ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVALID = "Invalid" + SKIPPED = "Skipped" + VALID = "Valid" + + +namespace azure.mgmt.databox.operations + + class azure.mgmt.databox.operations.JobsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[JobResource]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[JobResource]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[JobResource]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: JobResourceUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> LROPoller[JobResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: JobResourceUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> LROPoller[JobResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> LROPoller[JobResource]: ... + + @overload + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ShipmentPickUpResponse: ... + + @overload + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ShipmentPickUpResponse: ... + + @overload + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ShipmentPickUpResponse: ... + + @overload + def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + job_name: str, + *, + expand: Optional[str] = ..., + **kwargs: Any + ) -> JobResource: ... + + @distributed_trace + def list( + self, + *, + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[JobResource]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + *, + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[JobResource]: ... + + @distributed_trace + def list_credentials( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> ItemPaged[UnencryptedCredentials]: ... + + @overload + def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: MarkDevicesShippedRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: MarkDevicesShippedRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + + class azure.mgmt.databox.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.databox.operations.ServiceOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: AvailableSkuRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[SkuInformation]: ... + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: AvailableSkuRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[SkuInformation]: ... + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[SkuInformation]: ... + + @overload + def region_configuration( + self, + location: str, + region_configuration_request: RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + def region_configuration( + self, + location: str, + region_configuration_request: RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + def region_configuration( + self, + location: str, + region_configuration_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RegionConfigurationResponse: ... + + @overload + def validate_address( + self, + location: str, + validate_address: ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AddressValidationOutput: ... + + @overload + def validate_address( + self, + location: str, + validate_address: ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AddressValidationOutput: ... + + @overload + def validate_address( + self, + location: str, + validate_address: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AddressValidationOutput: ... + + @overload + def validate_inputs( + self, + location: str, + validation_request: ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + @overload + def validate_inputs( + self, + location: str, + validation_request: ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + @overload + def validate_inputs( + self, + location: str, + validation_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + @overload + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + @overload + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + @overload + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ValidationResponse: ... + + +namespace azure.mgmt.databox.types + + class azure.mgmt.databox.types.AccountCredentialDetails(TypedDict, total=False): + key "accountConnectionString": str + key "accountName": str + key "dataAccountType": Union[str, DataAccountType] + account_connection_string: str + account_name: str + data_account_type: Union[str, DataAccountType] + shareCredentialDetails: list[ShareCredentialDetails] + share_credential_details: list[ShareCredentialDetails] + + + class azure.mgmt.databox.types.AdditionalErrorInfo(TypedDict, total=False): + key "type": str + info: dict[str, Any] + type: str + + + class azure.mgmt.databox.types.AddressValidationOutput(TypedDict, total=False): + key "properties": ForwardRef('AddressValidationProperties', module='types') + properties: AddressValidationProperties + + + class azure.mgmt.databox.types.AddressValidationProperties(TypedDict, total=False): + key "error": ForwardRef('CloudError', module='types') + key "validationStatus": Union[str, AddressValidationStatus] + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS]] + alternateAddresses: list[ShippingAddress] + alternate_addresses: list[ShippingAddress] + error: CloudError + validation_status: Union[str, AddressValidationStatus] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS] + + + class azure.mgmt.databox.types.ApiError(TypedDict, total=False): + key "error": Required[ErrorDetail] + error: ErrorDetail + + + class azure.mgmt.databox.types.ApplianceNetworkConfiguration(TypedDict, total=False): + key "macAddress": str + key "name": str + mac_address: str + name: str + + + class azure.mgmt.databox.types.AvailableSkuRequest(TypedDict, total=False): + key "country": Required[str] + key "location": Required[str] + key "transferType": Required[Union[str, TransferType]] + country: str + location: str + skuNames: list[Union[str, SkuName]] + sku_names: list[Union[str, SkuName]] + transfer_type: Union[str, TransferType] + + + class azure.mgmt.databox.types.AzureFileFilterDetails(TypedDict, total=False): + filePathList: list[str] + filePrefixList: list[str] + fileShareList: list[str] + file_path_list: list[str] + file_prefix_list: list[str] + file_share_list: list[str] + + + class azure.mgmt.databox.types.BlobFilterDetails(TypedDict, total=False): + blobPathList: list[str] + blobPrefixList: list[str] + blob_path_list: list[str] + blob_prefix_list: list[str] + containerList: list[str] + container_list: list[str] + + + class azure.mgmt.databox.types.CancellationReason(TypedDict, total=False): + key "reason": Required[str] + reason: str + + + class azure.mgmt.databox.types.ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATA_BOX = "DataBox" + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + DATA_BOX_DISK = "DataBoxDisk" + DATA_BOX_HEAVY = "DataBoxHeavy" + + + class azure.mgmt.databox.types.CloudError(TypedDict, total=False): + key "code": str + key "message": str + key "target": str + additionalInfo: list[AdditionalErrorInfo] + additional_info: list[AdditionalErrorInfo] + code: str + details: list[CloudError] + message: str + target: str + + + class azure.mgmt.databox.types.ContactDetails(TypedDict, total=False): + key "contactName": Required[str] + key "emailList": Required[list[str]] + key "mobile": str + key "phone": Required[str] + key "phoneExtension": str + contact_name: str + email_list: list[str] + mobile: str + notificationPreference: list[NotificationPreference] + notification_preference: list[NotificationPreference] + phone: str + phone_extension: str + + + class azure.mgmt.databox.types.ContactInfo(TypedDict, total=False): + key "contactName": Required[str] + key "mobile": str + key "phone": Required[str] + key "phoneExtension": str + contact_name: str + mobile: str + phone: str + phone_extension: str + + + class azure.mgmt.databox.types.CopyProgress(TypedDict, total=False): + key "accountId": str + key "bytesProcessed": int + key "dataAccountType": Union[str, DataAccountType] + key "directoriesErroredOut": int + key "error": ForwardRef('CloudError', module='types') + key "filesErroredOut": int + key "filesProcessed": int + key "invalidDirectoriesProcessed": int + key "invalidFileBytesUploaded": int + key "invalidFilesProcessed": int + key "isEnumerationInProgress": bool + key "renamedContainerCount": int + key "storageAccountName": str + key "totalBytesToProcess": int + key "totalFilesToProcess": int + key "transferType": Union[str, TransferType] + account_id: str + actions: list[Union[str, CustomerResolutionCode]] + bytes_processed: int + data_account_type: Union[str, DataAccountType] + directories_errored_out: int + error: CloudError + files_errored_out: int + files_processed: int + invalid_directories_processed: int + invalid_file_bytes_uploaded: int + invalid_files_processed: int + is_enumeration_in_progress: bool + renamed_container_count: int + storage_account_name: str + total_bytes_to_process: int + total_files_to_process: int + transfer_type: Union[str, TransferType] + + + class azure.mgmt.databox.types.CreateJobValidations(TypedDict, total=False): + key "individualRequestDetails": Required[list[ValidationInputRequest]] + key "validationCategory": Required[Literal["JobCreationValidation"]] + individual_request_details: list[ValidationInputRequest] + validation_category: Literal[JobCreationValidation] + + + class azure.mgmt.databox.types.CreateOrderLimitForSubscriptionValidationRequest(TypedDict, total=False): + key "deviceType": Required[Union[str, SkuName]] + key "model": Union[str, ModelName] + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT]] + device_type: Union[str, SkuName] + model: Union[str, ModelName] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT] + + + class azure.mgmt.databox.types.CreateOrderLimitForSubscriptionValidationResponseProperties(TypedDict, total=False): + key "error": ForwardRef('CloudError', module='types') + key "status": Union[str, ValidationStatus] + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT]] + error: CloudError + status: Union[str, ValidationStatus] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT] + + + class azure.mgmt.databox.types.CustomerDiskJobSecrets(TypedDict, total=False): + key "carrierAccountNumber": str + key "dcAccessSecurityCode": ForwardRef('DcAccessSecurityCode', module='types') + key "error": ForwardRef('CloudError', module='types') + key "jobSecretsType": Required[Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK]] + carrier_account_number: str + dc_access_security_code: DcAccessSecurityCode + diskSecrets: list[DiskSecret] + disk_secrets: list[DiskSecret] + error: CloudError + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + + + class azure.mgmt.databox.types.DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED_DISK = "ManagedDisk" + STORAGE_ACCOUNT = "StorageAccount" + + + class azure.mgmt.databox.types.DataBoxAccountCopyLogDetails(TypedDict, total=False): + key "accountName": str + key "copyLogDetailsType": Required[Literal[ClassDiscriminator.DATA_BOX]] + key "copyLogLink": str + key "copyVerboseLogLink": str + account_name: str + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX] + copy_log_link: str + copy_verbose_log_link: str + + + class azure.mgmt.databox.types.DataBoxCustomerDiskCopyLogDetails(TypedDict, total=False): + key "copyLogDetailsType": Required[Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK]] + key "errorLogLink": str + key "serialNumber": str + key "verboseLogLink": str + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + error_log_link: str + serial_number: str + verbose_log_link: str + + + class azure.mgmt.databox.types.DataBoxCustomerDiskCopyProgress(CopyProgress): + key "accountId": str + key "bytesProcessed": int + key "copyStatus": Union[str, CopyStatus] + key "dataAccountType": Union[str, DataAccountType] + key "directoriesErroredOut": int + key "error": ForwardRef('CloudError', module='types') + key "filesErroredOut": int + key "filesProcessed": int + key "invalidDirectoriesProcessed": int + key "invalidFileBytesUploaded": int + key "invalidFilesProcessed": int + key "isEnumerationInProgress": bool + key "renamedContainerCount": int + key "serialNumber": str + key "storageAccountName": str + key "totalBytesToProcess": int + key "totalFilesToProcess": int + key "transferType": Union[str, TransferType] + account_id: str + actions: list[Union[str, CustomerResolutionCode]] + bytes_processed: int + copy_status: Union[str, CopyStatus] + data_account_type: Union[str, DataAccountType] + directories_errored_out: int + error: CloudError + files_errored_out: int + files_processed: int + invalid_directories_processed: int + invalid_file_bytes_uploaded: int + invalid_files_processed: int + is_enumeration_in_progress: bool + renamed_container_count: int + serial_number: str + storage_account_name: str + total_bytes_to_process: int + total_files_to_process: int + transfer_type: Union[str, TransferType] + + + class azure.mgmt.databox.types.DataBoxCustomerDiskJobDetails(TypedDict, total=False): + key "chainOfCustodySasKey": str + key "contactDetails": Required[ContactDetails] + key "dataCenterCode": Union[str, DataCenterCode] + key "datacenterAddress": ForwardRef('DatacenterAddressResponse', module='types') + key "deliverToDcPackageDetails": ForwardRef('PackageCarrierInfo', module='types') + key "deliveryPackage": ForwardRef('PackageShippingDetails', module='types') + key "deviceErasureDetails": ForwardRef('DeviceErasureDetails', module='types') + key "enableManifestBackup": bool + key "expectedDataSizeInTeraBytes": int + key "jobDetailsType": Required[Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK]] + key "keyEncryptionKey": ForwardRef('KeyEncryptionKey', module='types') + key "lastMitigationActionOnJob": ForwardRef('LastMitigationActionOnJob', module='types') + key "preferences": ForwardRef('Preferences', module='types') + key "returnPackage": ForwardRef('PackageShippingDetails', module='types') + key "returnToCustomerPackageDetails": Required[PackageCarrierDetails] + key "reverseShipmentLabelSasKey": str + key "reverseShippingDetails": ForwardRef('ReverseShippingDetails', module='types') + key "shippingAddress": ForwardRef('ShippingAddress', module='types') + actions: list[Union[str, CustomerResolutionCode]] + chain_of_custody_sas_key: str + contact_details: ContactDetails + copyLogDetails: list[CopyLogDetails] + copyProgress: list[DataBoxCustomerDiskCopyProgress] + copy_log_details: list[CopyLogDetails] + copy_progress: list[DataBoxCustomerDiskCopyProgress] + dataExportDetails: list[DataExportDetails] + dataImportDetails: list[DataImportDetails] + data_center_code: Union[str, DataCenterCode] + data_export_details: list[DataExportDetails] + data_import_details: list[DataImportDetails] + datacenter_address: DatacenterAddressResponse + deliver_to_dc_package_details: PackageCarrierInfo + delivery_package: PackageShippingDetails + device_erasure_details: DeviceErasureDetails + enable_manifest_backup: bool + expected_data_size_in_tera_bytes: int + exportDiskDetailsCollection: dict[str, ExportDiskDetails] + export_disk_details_collection: dict[str, ExportDiskDetails] + importDiskDetailsCollection: dict[str, ImportDiskDetails] + import_disk_details_collection: dict[str, ImportDiskDetails] + jobStages: list[JobStages] + job_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + job_stages: list[JobStages] + key_encryption_key: KeyEncryptionKey + last_mitigation_action_on_job: LastMitigationActionOnJob + preferences: Preferences + return_package: PackageShippingDetails + return_to_customer_package_details: PackageCarrierDetails + reverse_shipment_label_sas_key: str + reverse_shipping_details: ReverseShippingDetails + shipping_address: ShippingAddress + + + class azure.mgmt.databox.types.DataBoxDiskCopyLogDetails(TypedDict, total=False): + key "copyLogDetailsType": Required[Literal[ClassDiscriminator.DATA_BOX_DISK]] + key "diskSerialNumber": str + key "errorLogLink": str + key "verboseLogLink": str + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_DISK] + disk_serial_number: str + error_log_link: str + verbose_log_link: str + + + class azure.mgmt.databox.types.DataBoxDiskCopyProgress(TypedDict, total=False): + key "bytesCopied": int + key "error": ForwardRef('CloudError', module='types') + key "percentComplete": int + key "serialNumber": str + key "status": Union[str, CopyStatus] + actions: list[Union[str, CustomerResolutionCode]] + bytes_copied: int + error: CloudError + percent_complete: int + serial_number: str + status: Union[str, CopyStatus] + + + class azure.mgmt.databox.types.DataBoxDiskGranularCopyLogDetails(TypedDict, total=False): + key "accountId": str + key "copyLogDetailsType": Required[Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK]] + key "errorLogLink": str + key "serialNumber": str + key "verboseLogLink": str + account_id: str + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + error_log_link: str + serial_number: str + verbose_log_link: str + + + class azure.mgmt.databox.types.DataBoxDiskGranularCopyProgress(GranularCopyProgress): + key "accountId": str + key "bytesProcessed": int + key "copyStatus": Union[str, CopyStatus] + key "dataAccountType": Union[str, DataAccountType] + key "directoriesErroredOut": int + key "error": ForwardRef('CloudError', module='types') + key "filesErroredOut": int + key "filesProcessed": int + key "invalidDirectoriesProcessed": int + key "invalidFileBytesUploaded": int + key "invalidFilesProcessed": int + key "isEnumerationInProgress": bool + key "renamedContainerCount": int + key "serialNumber": str + key "storageAccountName": str + key "totalBytesToProcess": int + key "totalFilesToProcess": int + key "transferType": Union[str, TransferType] + account_id: str + actions: list[Union[str, CustomerResolutionCode]] + bytes_processed: int + copy_status: Union[str, CopyStatus] + data_account_type: Union[str, DataAccountType] + directories_errored_out: int + error: CloudError + files_errored_out: int + files_processed: int + invalid_directories_processed: int + invalid_file_bytes_uploaded: int + invalid_files_processed: int + is_enumeration_in_progress: bool + renamed_container_count: int + serial_number: str + storage_account_name: str + total_bytes_to_process: int + total_files_to_process: int + transfer_type: Union[str, TransferType] + + + class azure.mgmt.databox.types.DataBoxDiskJobDetails(TypedDict, total=False): + key "chainOfCustodySasKey": str + key "contactDetails": Required[ContactDetails] + key "dataCenterCode": Union[str, DataCenterCode] + key "datacenterAddress": ForwardRef('DatacenterAddressResponse', module='types') + key "deliveryPackage": ForwardRef('PackageShippingDetails', module='types') + key "deviceErasureDetails": ForwardRef('DeviceErasureDetails', module='types') + key "expectedDataSizeInTeraBytes": int + key "jobDetailsType": Required[Literal[ClassDiscriminator.DATA_BOX_DISK]] + key "keyEncryptionKey": ForwardRef('KeyEncryptionKey', module='types') + key "lastMitigationActionOnJob": ForwardRef('LastMitigationActionOnJob', module='types') + key "passkey": str + key "preferences": ForwardRef('Preferences', module='types') + key "returnPackage": ForwardRef('PackageShippingDetails', module='types') + key "reverseShipmentLabelSasKey": str + key "reverseShippingDetails": ForwardRef('ReverseShippingDetails', module='types') + key "shippingAddress": ForwardRef('ShippingAddress', module='types') + actions: list[Union[str, CustomerResolutionCode]] + chain_of_custody_sas_key: str + contact_details: ContactDetails + copyLogDetails: list[CopyLogDetails] + copyProgress: list[DataBoxDiskCopyProgress] + copy_log_details: list[CopyLogDetails] + copy_progress: list[DataBoxDiskCopyProgress] + dataExportDetails: list[DataExportDetails] + dataImportDetails: list[DataImportDetails] + data_center_code: Union[str, DataCenterCode] + data_export_details: list[DataExportDetails] + data_import_details: list[DataImportDetails] + datacenter_address: DatacenterAddressResponse + delivery_package: PackageShippingDetails + device_erasure_details: DeviceErasureDetails + disksAndSizeDetails: dict[str, int] + disks_and_size_details: dict[str, int] + expected_data_size_in_tera_bytes: int + granularCopyLogDetails: list[DataBoxDiskGranularCopyLogDetails] + granularCopyProgress: list[DataBoxDiskGranularCopyProgress] + granular_copy_log_details: list[DataBoxDiskGranularCopyLogDetails] + granular_copy_progress: list[DataBoxDiskGranularCopyProgress] + jobStages: list[JobStages] + job_details_type: Literal[ClassDiscriminator.DATA_BOX_DISK] + job_stages: list[JobStages] + key_encryption_key: KeyEncryptionKey + last_mitigation_action_on_job: LastMitigationActionOnJob + passkey: str + preferences: Preferences + preferredDisks: dict[str, int] + preferred_disks: dict[str, int] + return_package: PackageShippingDetails + reverse_shipment_label_sas_key: str + reverse_shipping_details: ReverseShippingDetails + shipping_address: ShippingAddress + + + class azure.mgmt.databox.types.DataBoxDiskJobSecrets(TypedDict, total=False): + key "dcAccessSecurityCode": ForwardRef('DcAccessSecurityCode', module='types') + key "error": ForwardRef('CloudError', module='types') + key "isPasskeyUserDefined": bool + key "jobSecretsType": Required[Literal[ClassDiscriminator.DATA_BOX_DISK]] + key "passKey": str + dc_access_security_code: DcAccessSecurityCode + diskSecrets: list[DiskSecret] + disk_secrets: list[DiskSecret] + error: CloudError + is_passkey_user_defined: bool + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_DISK] + pass_key: str + + + class azure.mgmt.databox.types.DataBoxHeavyAccountCopyLogDetails(TypedDict, total=False): + key "accountName": str + key "copyLogDetailsType": Required[Literal[ClassDiscriminator.DATA_BOX_HEAVY]] + account_name: str + copyLogLink: list[str] + copyVerboseLogLink: list[str] + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] + copy_log_link: list[str] + copy_verbose_log_link: list[str] + + + class azure.mgmt.databox.types.DataBoxHeavyJobDetails(TypedDict, total=False): + key "chainOfCustodySasKey": str + key "contactDetails": Required[ContactDetails] + key "dataCenterCode": Union[str, DataCenterCode] + key "datacenterAddress": ForwardRef('DatacenterAddressResponse', module='types') + key "deliveryPackage": ForwardRef('PackageShippingDetails', module='types') + key "deviceErasureDetails": ForwardRef('DeviceErasureDetails', module='types') + key "devicePassword": str + key "expectedDataSizeInTeraBytes": int + key "jobDetailsType": Required[Literal[ClassDiscriminator.DATA_BOX_HEAVY]] + key "keyEncryptionKey": ForwardRef('KeyEncryptionKey', module='types') + key "lastMitigationActionOnJob": ForwardRef('LastMitigationActionOnJob', module='types') + key "preferences": ForwardRef('Preferences', module='types') + key "returnPackage": ForwardRef('PackageShippingDetails', module='types') + key "reverseShipmentLabelSasKey": str + key "reverseShippingDetails": ForwardRef('ReverseShippingDetails', module='types') + key "shippingAddress": ForwardRef('ShippingAddress', module='types') + actions: list[Union[str, CustomerResolutionCode]] + chain_of_custody_sas_key: str + contact_details: ContactDetails + copyLogDetails: list[CopyLogDetails] + copyProgress: list[CopyProgress] + copy_log_details: list[CopyLogDetails] + copy_progress: list[CopyProgress] + dataExportDetails: list[DataExportDetails] + dataImportDetails: list[DataImportDetails] + data_center_code: Union[str, DataCenterCode] + data_export_details: list[DataExportDetails] + data_import_details: list[DataImportDetails] + datacenter_address: DatacenterAddressResponse + delivery_package: PackageShippingDetails + device_erasure_details: DeviceErasureDetails + device_password: str + expected_data_size_in_tera_bytes: int + jobStages: list[JobStages] + job_details_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] + job_stages: list[JobStages] + key_encryption_key: KeyEncryptionKey + last_mitigation_action_on_job: LastMitigationActionOnJob + preferences: Preferences + return_package: PackageShippingDetails + reverse_shipment_label_sas_key: str + reverse_shipping_details: ReverseShippingDetails + shipping_address: ShippingAddress + + + class azure.mgmt.databox.types.DataBoxHeavyJobSecrets(TypedDict, total=False): + key "dcAccessSecurityCode": ForwardRef('DcAccessSecurityCode', module='types') + key "error": ForwardRef('CloudError', module='types') + key "jobSecretsType": Required[Literal[ClassDiscriminator.DATA_BOX_HEAVY]] + cabinetPodSecrets: list[DataBoxHeavySecret] + cabinet_pod_secrets: list[DataBoxHeavySecret] + dc_access_security_code: DcAccessSecurityCode + error: CloudError + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] + + + class azure.mgmt.databox.types.DataBoxHeavySecret(TypedDict, total=False): + key "devicePassword": str + key "deviceSerialNumber": str + key "encodedValidationCertPubKey": str + accountCredentialDetails: list[AccountCredentialDetails] + account_credential_details: list[AccountCredentialDetails] + device_password: str + device_serial_number: str + encoded_validation_cert_pub_key: str + networkConfigurations: list[ApplianceNetworkConfiguration] + network_configurations: list[ApplianceNetworkConfiguration] + + + class azure.mgmt.databox.types.DataBoxJobDetails(TypedDict, total=False): + key "chainOfCustodySasKey": str + key "contactDetails": Required[ContactDetails] + key "dataCenterCode": Union[str, DataCenterCode] + key "datacenterAddress": ForwardRef('DatacenterAddressResponse', module='types') + key "deliveryPackage": ForwardRef('PackageShippingDetails', module='types') + key "deviceErasureDetails": ForwardRef('DeviceErasureDetails', module='types') + key "devicePassword": str + key "expectedDataSizeInTeraBytes": int + key "jobDetailsType": Required[Literal[ClassDiscriminator.DATA_BOX]] + key "keyEncryptionKey": ForwardRef('KeyEncryptionKey', module='types') + key "lastMitigationActionOnJob": ForwardRef('LastMitigationActionOnJob', module='types') + key "preferences": ForwardRef('Preferences', module='types') + key "returnPackage": ForwardRef('PackageShippingDetails', module='types') + key "reverseShipmentLabelSasKey": str + key "reverseShippingDetails": ForwardRef('ReverseShippingDetails', module='types') + key "shippingAddress": ForwardRef('ShippingAddress', module='types') + actions: list[Union[str, CustomerResolutionCode]] + chain_of_custody_sas_key: str + contact_details: ContactDetails + copyLogDetails: list[CopyLogDetails] + copyProgress: list[CopyProgress] + copy_log_details: list[CopyLogDetails] + copy_progress: list[CopyProgress] + dataExportDetails: list[DataExportDetails] + dataImportDetails: list[DataImportDetails] + data_center_code: Union[str, DataCenterCode] + data_export_details: list[DataExportDetails] + data_import_details: list[DataImportDetails] + datacenter_address: DatacenterAddressResponse + delivery_package: PackageShippingDetails + device_erasure_details: DeviceErasureDetails + device_password: str + expected_data_size_in_tera_bytes: int + jobStages: list[JobStages] + job_details_type: Literal[ClassDiscriminator.DATA_BOX] + job_stages: list[JobStages] + key_encryption_key: KeyEncryptionKey + last_mitigation_action_on_job: LastMitigationActionOnJob + preferences: Preferences + return_package: PackageShippingDetails + reverse_shipment_label_sas_key: str + reverse_shipping_details: ReverseShippingDetails + shipping_address: ShippingAddress + + + class azure.mgmt.databox.types.DataBoxScheduleAvailabilityRequest(TypedDict, total=False): + key "country": str + key "model": Union[str, ModelName] + key "skuName": Required[Literal[SkuName.DATA_BOX]] + key "storageLocation": Required[str] + country: str + model: Union[str, ModelName] + sku_name: Literal[SkuName.DATA_BOX] + storage_location: str + + + class azure.mgmt.databox.types.DataBoxSecret(TypedDict, total=False): + key "devicePassword": str + key "deviceSerialNumber": str + key "encodedValidationCertPubKey": str + accountCredentialDetails: list[AccountCredentialDetails] + account_credential_details: list[AccountCredentialDetails] + device_password: str + device_serial_number: str + encoded_validation_cert_pub_key: str + networkConfigurations: list[ApplianceNetworkConfiguration] + network_configurations: list[ApplianceNetworkConfiguration] + + + class azure.mgmt.databox.types.DataExportDetails(TypedDict, total=False): + key "accountDetails": Required[DataAccountDetails] + key "logCollectionLevel": Union[str, LogCollectionLevel] + key "transferConfiguration": Required[TransferConfiguration] + account_details: DataAccountDetails + log_collection_level: Union[str, LogCollectionLevel] + transfer_configuration: TransferConfiguration + + + class azure.mgmt.databox.types.DataImportDetails(TypedDict, total=False): + key "accountDetails": Required[DataAccountDetails] + key "logCollectionLevel": Union[str, LogCollectionLevel] + account_details: DataAccountDetails + log_collection_level: Union[str, LogCollectionLevel] + + + class azure.mgmt.databox.types.DataLocationToServiceLocationMap(TypedDict, total=False): + key "dataLocation": str + key "serviceLocation": str + data_location: str + service_location: str + + + class azure.mgmt.databox.types.DataTransferDetailsValidationRequest(TypedDict, total=False): + key "deviceType": Required[Union[str, SkuName]] + key "model": Union[str, ModelName] + key "transferType": Required[Union[str, TransferType]] + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS]] + dataExportDetails: list[DataExportDetails] + dataImportDetails: list[DataImportDetails] + data_export_details: list[DataExportDetails] + data_import_details: list[DataImportDetails] + device_type: Union[str, SkuName] + model: Union[str, ModelName] + transfer_type: Union[str, TransferType] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS] + + + class azure.mgmt.databox.types.DataTransferDetailsValidationResponseProperties(TypedDict, total=False): + key "error": ForwardRef('CloudError', module='types') + key "status": Union[str, ValidationStatus] + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS]] + error: CloudError + status: Union[str, ValidationStatus] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS] + + + class azure.mgmt.databox.types.DataboxJobSecrets(TypedDict, total=False): + key "dcAccessSecurityCode": ForwardRef('DcAccessSecurityCode', module='types') + key "error": ForwardRef('CloudError', module='types') + key "jobSecretsType": Required[Literal[ClassDiscriminator.DATA_BOX]] + dc_access_security_code: DcAccessSecurityCode + error: CloudError + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX] + podSecrets: list[DataBoxSecret] + pod_secrets: list[DataBoxSecret] + + + class azure.mgmt.databox.types.DatacenterAddressInstructionResponse(TypedDict, total=False): + key "communicationInstruction": str + key "dataCenterAzureLocation": str + key "datacenterAddressType": Required[Literal[DatacenterAddressType.DATACENTER_ADDRESS_INSTRUCTION]] + communication_instruction: str + data_center_azure_location: str + datacenter_address_type: Literal[DatacenterAddressType.DATACENTER_ADDRESS_INSTRUCTION] + supportedCarriersForReturnShipment: list[str] + supported_carriers_for_return_shipment: list[str] + + + class azure.mgmt.databox.types.DatacenterAddressLocationResponse(TypedDict, total=False): + key "additionalShippingInformation": str + key "addressType": str + key "city": str + key "company": str + key "contactPersonName": str + key "country": str + key "dataCenterAzureLocation": str + key "datacenterAddressType": Required[Literal[DatacenterAddressType.DATACENTER_ADDRESS_LOCATION]] + key "phone": str + key "phoneExtension": str + key "state": str + key "street1": str + key "street2": str + key "street3": str + key "zip": str + additional_shipping_information: str + address_type: str + city: str + company: str + contact_person_name: str + country: str + data_center_azure_location: str + datacenter_address_type: Literal[DatacenterAddressType.DATACENTER_ADDRESS_LOCATION] + phone: str + phone_extension: str + state: str + street1: str + street2: str + street3: str + supportedCarriersForReturnShipment: list[str] + supported_carriers_for_return_shipment: list[str] + zip: str + + + class azure.mgmt.databox.types.DatacenterAddressRequest(TypedDict, total=False): + key "model": Union[str, ModelName] + key "skuName": Required[Union[str, SkuName]] + key "storageLocation": Required[str] + model: Union[str, ModelName] + sku_name: Union[str, SkuName] + storage_location: str + + + class azure.mgmt.databox.types.DatacenterAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATACENTER_ADDRESS_INSTRUCTION = "DatacenterAddressInstruction" + DATACENTER_ADDRESS_LOCATION = "DatacenterAddressLocation" + + + class azure.mgmt.databox.types.DcAccessSecurityCode(TypedDict, total=False): + key "forwardDCAccessCode": str + key "reverseDCAccessCode": str + forward_dc_access_code: str + reverse_dc_access_code: str + + + class azure.mgmt.databox.types.Details(TypedDict, total=False): + key "code": Required[str] + key "message": Required[str] + code: str + message: str + + + class azure.mgmt.databox.types.DeviceCapabilityDetails(TypedDict, total=False): + key "hardwareEncryption": Union[str, HardwareEncryption] + hardware_encryption: Union[str, HardwareEncryption] + + + class azure.mgmt.databox.types.DeviceCapabilityRequest(TypedDict, total=False): + key "model": Union[str, ModelName] + key "skuName": Union[str, SkuName] + model: Union[str, ModelName] + sku_name: Union[str, SkuName] + + + class azure.mgmt.databox.types.DeviceCapabilityResponse(TypedDict, total=False): + deviceCapabilityDetails: list[DeviceCapabilityDetails] + device_capability_details: list[DeviceCapabilityDetails] + + + class azure.mgmt.databox.types.DeviceErasureDetails(TypedDict, total=False): + key "deviceErasureStatus": Union[str, StageStatus] + key "erasureOrDestructionCertificateSasKey": str + key "secureErasureCertificateSasKey": str + device_erasure_status: Union[str, StageStatus] + erasure_or_destruction_certificate_sas_key: str + secure_erasure_certificate_sas_key: str + + + class azure.mgmt.databox.types.DiskScheduleAvailabilityRequest(TypedDict, total=False): + key "country": str + key "expectedDataSizeInTeraBytes": Required[int] + key "model": Union[str, ModelName] + key "skuName": Required[Literal[SkuName.DATA_BOX_DISK]] + key "storageLocation": Required[str] + country: str + expected_data_size_in_tera_bytes: int + model: Union[str, ModelName] + sku_name: Literal[SkuName.DATA_BOX_DISK] + storage_location: str + + + class azure.mgmt.databox.types.DiskSecret(TypedDict, total=False): + key "bitLockerKey": str + key "diskSerialNumber": str + bit_locker_key: str + disk_serial_number: str + + + class azure.mgmt.databox.types.EncryptionPreferences(TypedDict, total=False): + key "doubleEncryption": Union[str, DoubleEncryption] + key "hardwareEncryption": Union[str, HardwareEncryption] + double_encryption: Union[str, DoubleEncryption] + hardware_encryption: Union[str, HardwareEncryption] + + + class azure.mgmt.databox.types.ErrorDetail(TypedDict, total=False): + key "code": Required[str] + key "message": Required[str] + key "target": str + code: str + details: list[Details] + message: str + target: str + + + class azure.mgmt.databox.types.ExportDiskDetails(TypedDict, total=False): + key "backupManifestCloudPath": str + key "manifestFile": str + key "manifestHash": str + backup_manifest_cloud_path: str + manifest_file: str + manifest_hash: str + + + class azure.mgmt.databox.types.FilterFileDetails(TypedDict, total=False): + key "filterFilePath": Required[str] + key "filterFileType": Required[Union[str, FilterFileType]] + filter_file_path: str + filter_file_type: Union[str, FilterFileType] + + + class azure.mgmt.databox.types.GranularCopyLogDetails(TypedDict, total=False): + key "accountId": str + key "copyLogDetailsType": Required[Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK]] + key "errorLogLink": str + key "serialNumber": str + key "verboseLogLink": str + account_id: str + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + error_log_link: str + serial_number: str + verbose_log_link: str + + + class azure.mgmt.databox.types.GranularCopyProgress(TypedDict, total=False): + key "accountId": str + key "bytesProcessed": int + key "dataAccountType": Union[str, DataAccountType] + key "directoriesErroredOut": int + key "error": ForwardRef('CloudError', module='types') + key "filesErroredOut": int + key "filesProcessed": int + key "invalidDirectoriesProcessed": int + key "invalidFileBytesUploaded": int + key "invalidFilesProcessed": int + key "isEnumerationInProgress": bool + key "renamedContainerCount": int + key "storageAccountName": str + key "totalBytesToProcess": int + key "totalFilesToProcess": int + key "transferType": Union[str, TransferType] + account_id: str + actions: list[Union[str, CustomerResolutionCode]] + bytes_processed: int + data_account_type: Union[str, DataAccountType] + directories_errored_out: int + error: CloudError + files_errored_out: int + files_processed: int + invalid_directories_processed: int + invalid_file_bytes_uploaded: int + invalid_files_processed: int + is_enumeration_in_progress: bool + renamed_container_count: int + storage_account_name: str + total_bytes_to_process: int + total_files_to_process: int + transfer_type: Union[str, TransferType] + + + class azure.mgmt.databox.types.HeavyScheduleAvailabilityRequest(TypedDict, total=False): + key "country": str + key "model": Union[str, ModelName] + key "skuName": Required[Literal[SkuName.DATA_BOX_HEAVY]] + key "storageLocation": Required[str] + country: str + model: Union[str, ModelName] + sku_name: Literal[SkuName.DATA_BOX_HEAVY] + storage_location: str + + + class azure.mgmt.databox.types.IdentityProperties(TypedDict, total=False): + key "type": str + key "userAssigned": ForwardRef('UserAssignedProperties', module='types') + type: str + user_assigned: UserAssignedProperties + + + class azure.mgmt.databox.types.ImportDiskDetails(TypedDict, total=False): + key "backupManifestCloudPath": str + key "bitLockerKey": Required[str] + key "manifestFile": Required[str] + key "manifestHash": Required[str] + backup_manifest_cloud_path: str + bit_locker_key: str + manifest_file: str + manifest_hash: str + + + class azure.mgmt.databox.types.JobDelayDetails(TypedDict, total=False): + key "description": str + key "errorCode": Union[str, PortalDelayErrorCode] + key "resolutionTime": str + key "startTime": str + key "status": Union[str, DelayNotificationStatus] + description: str + error_code: Union[str, PortalDelayErrorCode] + resolution_time: str + start_time: str + status: Union[str, DelayNotificationStatus] + + + class azure.mgmt.databox.types.JobDeliveryInfo(TypedDict, total=False): + key "scheduledDateTime": str + scheduled_date_time: str + + + class azure.mgmt.databox.types.JobProperties(TypedDict, total=False): + key "allDevicesLost": bool + key "cancellationReason": str + key "delayedStage": Union[str, StageName] + key "deliveryInfo": ForwardRef('JobDeliveryInfo', module='types') + key "deliveryType": Union[str, JobDeliveryType] + key "details": ForwardRef('JobDetails', module='types') + key "error": ForwardRef('CloudError', module='types') + key "isCancellable": bool + key "isCancellableWithoutFee": bool + key "isDeletable": bool + key "isPrepareToShipEnabled": bool + key "isShippingAddressEditable": bool + key "reverseShippingDetailsUpdate": Union[str, ReverseShippingDetailsEditStatus] + key "reverseTransportPreferenceUpdate": Union[str, ReverseTransportPreferenceEditStatus] + key "startTime": str + key "status": Union[str, StageName] + key "transferType": Required[Union[str, TransferType]] + all_devices_lost: bool + cancellation_reason: str + delayed_stage: Union[str, StageName] + delivery_info: JobDeliveryInfo + delivery_type: Union[str, JobDeliveryType] + details: JobDetails + error: CloudError + is_cancellable: bool + is_cancellable_without_fee: bool + is_deletable: bool + is_prepare_to_ship_enabled: bool + is_shipping_address_editable: bool + reverse_shipping_details_update: Union[str, ReverseShippingDetailsEditStatus] + reverse_transport_preference_update: Union[str, ReverseTransportPreferenceEditStatus] + start_time: str + status: Union[str, StageName] + transfer_type: Union[str, TransferType] + + + class azure.mgmt.databox.types.JobResource(TrackedResource): + key "id": str + key "identity": ForwardRef('ResourceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": Required[JobProperties] + key "sku": Required[Sku] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ResourceIdentity + location: str + name: str + properties: JobProperties + sku: Sku + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.databox.types.JobResourceUpdateParameter(TypedDict, total=False): + key "identity": ForwardRef('ResourceIdentity', module='types') + key "properties": ForwardRef('UpdateJobProperties', module='types') + identity: ResourceIdentity + properties: UpdateJobProperties + tags: dict[str, str] + + + class azure.mgmt.databox.types.JobStages(TypedDict, total=False): + key "displayName": str + key "jobStageDetails": Any + key "stageName": Union[str, StageName] + key "stageStatus": Union[str, StageStatus] + key "stageTime": str + delayInformation: list[JobDelayDetails] + delay_information: list[JobDelayDetails] + display_name: str + job_stage_details: Any + stage_name: Union[str, StageName] + stage_status: Union[str, StageStatus] + stage_time: str + + + class azure.mgmt.databox.types.KeyEncryptionKey(TypedDict, total=False): + key "identityProperties": ForwardRef('IdentityProperties', module='types') + key "kekType": Required[Union[str, KekType]] + key "kekUrl": str + key "kekVaultResourceID": str + identity_properties: IdentityProperties + kek_type: Union[str, KekType] + kek_url: str + kek_vault_resource_id: str + + + class azure.mgmt.databox.types.LastMitigationActionOnJob(TypedDict, total=False): + key "actionDateTimeInUtc": str + key "customerResolution": Union[str, CustomerResolutionCode] + key "isPerformedByCustomer": bool + action_date_time_in_utc: str + customer_resolution: Union[str, CustomerResolutionCode] + is_performed_by_customer: bool + + + class azure.mgmt.databox.types.ManagedDiskDetails(TypedDict, total=False): + key "dataAccountType": Required[Literal[DataAccountType.MANAGED_DISK]] + key "resourceGroupId": Required[str] + key "sharePassword": str + key "stagingStorageAccountId": Required[str] + data_account_type: Literal[DataAccountType.MANAGED_DISK] + resource_group_id: str + share_password: str + staging_storage_account_id: str + + + class azure.mgmt.databox.types.MarkDevicesShippedRequest(TypedDict, total=False): + key "deliverToDcPackageDetails": Required[PackageCarrierInfo] + deliver_to_dc_package_details: PackageCarrierInfo + + + class azure.mgmt.databox.types.MitigateJobRequest(TypedDict, total=False): + key "customerResolutionCode": Union[str, CustomerResolutionCode] + customer_resolution_code: Union[str, CustomerResolutionCode] + serialNumberCustomerResolutionMap: dict[str, Union[str, CustomerResolutionCode]] + serial_number_customer_resolution_map: dict[str, Union[str, CustomerResolutionCode]] + + + class azure.mgmt.databox.types.NotificationPreference(TypedDict, total=False): + key "sendNotification": Required[bool] + key "stageName": Required[Union[str, NotificationStageName]] + send_notification: bool + stage_name: Union[str, NotificationStageName] + + + class azure.mgmt.databox.types.Operation(TypedDict, total=False): + key "display": ForwardRef('OperationDisplay', module='types') + key "isDataAction": bool + key "name": str + key "origin": str + key "properties": ForwardRef('OperationProperties', module='types') + display: OperationDisplay + is_data_action: bool + name: str + origin: str + properties: OperationProperties + + + class azure.mgmt.databox.types.OperationDisplay(TypedDict, total=False): + key "description": str + key "operation": str + key "provider": str + key "resource": str + description: str + operation: str + provider: str + resource: str + + + class azure.mgmt.databox.types.OperationProperties(TypedDict, total=False): + + + class azure.mgmt.databox.types.PackageCarrierDetails(TypedDict, total=False): + key "carrierAccountNumber": str + key "carrierName": str + key "trackingId": str + carrier_account_number: str + carrier_name: str + tracking_id: str + + + class azure.mgmt.databox.types.PackageCarrierInfo(TypedDict, total=False): + key "carrierName": str + key "trackingId": str + carrier_name: str + tracking_id: str + + + class azure.mgmt.databox.types.PackageShippingDetails(TypedDict, total=False): + key "carrierName": str + key "trackingId": str + key "trackingUrl": str + carrier_name: str + tracking_id: str + tracking_url: str + + + class azure.mgmt.databox.types.Preferences(TypedDict, total=False): + key "encryptionPreferences": ForwardRef('EncryptionPreferences', module='types') + key "reverseTransportPreferences": ForwardRef('TransportPreferences', module='types') + key "transportPreferences": ForwardRef('TransportPreferences', module='types') + encryption_preferences: EncryptionPreferences + preferredDataCenterRegion: list[str] + preferred_data_center_region: list[str] + reverse_transport_preferences: TransportPreferences + storageAccountAccessTierPreferences: list[Literal["Archive"]] + storage_account_access_tier_preferences: list[Literal[Archive]] + transport_preferences: TransportPreferences + + + class azure.mgmt.databox.types.PreferencesValidationRequest(TypedDict, total=False): + key "deviceType": Required[Union[str, SkuName]] + key "model": Union[str, ModelName] + key "preference": ForwardRef('Preferences', module='types') + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES]] + device_type: Union[str, SkuName] + model: Union[str, ModelName] + preference: Preferences + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES] + + + class azure.mgmt.databox.types.PreferencesValidationResponseProperties(TypedDict, total=False): + key "error": ForwardRef('CloudError', module='types') + key "status": Union[str, ValidationStatus] + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES]] + error: CloudError + status: Union[str, ValidationStatus] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES] + + + class azure.mgmt.databox.types.RegionConfigurationRequest(TypedDict, total=False): + key "datacenterAddressRequest": ForwardRef('DatacenterAddressRequest', module='types') + key "deviceCapabilityRequest": ForwardRef('DeviceCapabilityRequest', module='types') + key "scheduleAvailabilityRequest": ForwardRef('ScheduleAvailabilityRequest', module='types') + key "transportAvailabilityRequest": ForwardRef('TransportAvailabilityRequest', module='types') + datacenter_address_request: DatacenterAddressRequest + device_capability_request: DeviceCapabilityRequest + schedule_availability_request: ScheduleAvailabilityRequest + transport_availability_request: TransportAvailabilityRequest + + + class azure.mgmt.databox.types.RegionConfigurationResponse(TypedDict, total=False): + key "datacenterAddressResponse": ForwardRef('DatacenterAddressResponse', module='types') + key "deviceCapabilityResponse": ForwardRef('DeviceCapabilityResponse', module='types') + key "scheduleAvailabilityResponse": ForwardRef('ScheduleAvailabilityResponse', module='types') + key "transportAvailabilityResponse": ForwardRef('TransportAvailabilityResponse', module='types') + datacenter_address_response: DatacenterAddressResponse + device_capability_response: DeviceCapabilityResponse + schedule_availability_response: ScheduleAvailabilityResponse + transport_availability_response: TransportAvailabilityResponse + + + class azure.mgmt.databox.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.databox.types.ResourceIdentity(TypedDict, total=False): + key "principalId": str + key "tenantId": str + key "type": str + principal_id: str + tenant_id: str + type: str + userAssignedIdentities: dict[str, UserAssignedIdentity] + user_assigned_identities: dict[str, UserAssignedIdentity] + + + class azure.mgmt.databox.types.ReverseShippingDetails(TypedDict, total=False): + key "contactDetails": ForwardRef('ContactInfo', module='types') + key "isUpdated": bool + key "shippingAddress": ForwardRef('ShippingAddress', module='types') + contact_details: ContactInfo + is_updated: bool + shipping_address: ShippingAddress + + + class azure.mgmt.databox.types.ScheduleAvailabilityResponse(TypedDict, total=False): + availableDates: list[str] + available_dates: list[str] + + + class azure.mgmt.databox.types.ShareCredentialDetails(TypedDict, total=False): + key "password": str + key "shareName": str + key "shareType": Union[str, ShareDestinationFormatType] + key "userName": str + password: str + share_name: str + share_type: Union[str, ShareDestinationFormatType] + supportedAccessProtocols: list[Union[str, AccessProtocol]] + supported_access_protocols: list[Union[str, AccessProtocol]] + user_name: str + + + class azure.mgmt.databox.types.ShipmentPickUpRequest(TypedDict, total=False): + key "endTime": Required[str] + key "shipmentLocation": Required[str] + key "startTime": Required[str] + end_time: str + shipment_location: str + start_time: str + + + class azure.mgmt.databox.types.ShipmentPickUpResponse(TypedDict, total=False): + key "confirmationNumber": str + key "readyByTime": str + confirmation_number: str + ready_by_time: str + + + class azure.mgmt.databox.types.ShippingAddress(TypedDict, total=False): + key "addressType": Union[str, AddressType] + key "city": str + key "companyName": str + key "country": Required[str] + key "postalCode": str + key "skipAddressValidation": bool + key "stateOrProvince": str + key "streetAddress1": Required[str] + key "streetAddress2": str + key "streetAddress3": str + key "taxIdentificationNumber": str + key "zipExtendedCode": str + address_type: Union[str, AddressType] + city: str + company_name: str + country: str + postal_code: str + skip_address_validation: bool + state_or_province: str + street_address1: str + street_address2: str + street_address3: str + tax_identification_number: str + zip_extended_code: str + + + class azure.mgmt.databox.types.Sku(TypedDict, total=False): + key "displayName": str + key "family": str + key "model": Union[str, ModelName] + key "name": Required[Union[str, SkuName]] + display_name: str + family: str + model: Union[str, ModelName] + name: Union[str, SkuName] + + + class azure.mgmt.databox.types.SkuAvailabilityValidationRequest(TypedDict, total=False): + key "country": Required[str] + key "deviceType": Required[Union[str, SkuName]] + key "location": Required[str] + key "model": Union[str, ModelName] + key "transferType": Required[Union[str, TransferType]] + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY]] + country: str + device_type: Union[str, SkuName] + location: str + model: Union[str, ModelName] + transfer_type: Union[str, TransferType] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY] + + + class azure.mgmt.databox.types.SkuAvailabilityValidationResponseProperties(TypedDict, total=False): + key "error": ForwardRef('CloudError', module='types') + key "status": Union[str, ValidationStatus] + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY]] + error: CloudError + status: Union[str, ValidationStatus] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY] + + + class azure.mgmt.databox.types.SkuCapacity(TypedDict, total=False): + key "individualSkuUsable": str + key "maximum": str + key "usable": str + individual_sku_usable: str + maximum: str + usable: str + + + class azure.mgmt.databox.types.SkuCost(TypedDict, total=False): + key "meterId": str + key "meterType": str + key "multiplier": float + meter_id: str + meter_type: str + multiplier: float + + + class azure.mgmt.databox.types.SkuInformation(TypedDict, total=False): + key "enabled": bool + key "properties": ForwardRef('SkuProperties', module='types') + key "sku": ForwardRef('Sku', module='types') + enabled: bool + properties: SkuProperties + sku: Sku + + + class azure.mgmt.databox.types.SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATA_BOX = "DataBox" + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + DATA_BOX_DISK = "DataBoxDisk" + DATA_BOX_HEAVY = "DataBoxHeavy" + + + class azure.mgmt.databox.types.SkuProperties(TypedDict, total=False): + key "capacity": ForwardRef('SkuCapacity', module='types') + key "disabledReason": Union[str, SkuDisabledReason] + key "disabledReasonMessage": str + key "requiredFeature": str + apiVersions: list[str] + api_versions: list[str] + capacity: SkuCapacity + costs: list[SkuCost] + countriesWithinCommerceBoundary: list[str] + countries_within_commerce_boundary: list[str] + dataLocationToServiceLocationMap: list[DataLocationToServiceLocationMap] + data_location_to_service_location_map: list[DataLocationToServiceLocationMap] + disabled_reason: Union[str, SkuDisabledReason] + disabled_reason_message: str + required_feature: str + + + class azure.mgmt.databox.types.StorageAccountDetails(TypedDict, total=False): + key "dataAccountType": Required[Literal[DataAccountType.STORAGE_ACCOUNT]] + key "sharePassword": str + key "storageAccountId": Required[str] + data_account_type: Literal[DataAccountType.STORAGE_ACCOUNT] + share_password: str + storage_account_id: str + + + class azure.mgmt.databox.types.SubscriptionIsAllowedToCreateJobValidationRequest(TypedDict, total=False): + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB]] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB] + + + class azure.mgmt.databox.types.SubscriptionIsAllowedToCreateJobValidationResponseProperties(TypedDict, total=False): + key "error": ForwardRef('CloudError', module='types') + key "status": Union[str, ValidationStatus] + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB]] + error: CloudError + status: Union[str, ValidationStatus] + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB] + + + class azure.mgmt.databox.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + created_at: str + created_by: str + created_by_type: Union[str, CreatedByType] + last_modified_at: str + last_modified_by: str + last_modified_by_type: Union[str, CreatedByType] + + + class azure.mgmt.databox.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.databox.types.TransferAllDetails(TypedDict, total=False): + key "dataAccountType": Required[Union[str, DataAccountType]] + key "transferAllBlobs": bool + key "transferAllFiles": bool + data_account_type: Union[str, DataAccountType] + transfer_all_blobs: bool + transfer_all_files: bool + + + class azure.mgmt.databox.types.TransferConfiguration(TypedDict, total=False): + key "transferAllDetails": ForwardRef('TransferConfigurationTransferAllDetails', module='types') + key "transferConfigurationType": Required[Union[str, TransferConfigurationType]] + key "transferFilterDetails": ForwardRef('TransferConfigurationTransferFilterDetails', module='types') + transfer_all_details: TransferConfigurationTransferAllDetails + transfer_configuration_type: Union[str, TransferConfigurationType] + transfer_filter_details: TransferConfigurationTransferFilterDetails + + + class azure.mgmt.databox.types.TransferConfigurationTransferAllDetails(TypedDict, total=False): + key "include": ForwardRef('TransferAllDetails', module='types') + include: TransferAllDetails + + + class azure.mgmt.databox.types.TransferConfigurationTransferFilterDetails(TypedDict, total=False): + key "include": ForwardRef('TransferFilterDetails', module='types') + include: TransferFilterDetails + + + class azure.mgmt.databox.types.TransferFilterDetails(TypedDict, total=False): + key "azureFileFilterDetails": ForwardRef('AzureFileFilterDetails', module='types') + key "blobFilterDetails": ForwardRef('BlobFilterDetails', module='types') + key "dataAccountType": Required[Union[str, DataAccountType]] + azure_file_filter_details: AzureFileFilterDetails + blob_filter_details: BlobFilterDetails + data_account_type: Union[str, DataAccountType] + filterFileDetails: list[FilterFileDetails] + filter_file_details: list[FilterFileDetails] + + + class azure.mgmt.databox.types.TransportAvailabilityDetails(TypedDict, total=False): + key "shipmentType": Union[str, TransportShipmentTypes] + shipment_type: Union[str, TransportShipmentTypes] + + + class azure.mgmt.databox.types.TransportAvailabilityRequest(TypedDict, total=False): + key "model": Union[str, ModelName] + key "skuName": Union[str, SkuName] + model: Union[str, ModelName] + sku_name: Union[str, SkuName] + + + class azure.mgmt.databox.types.TransportAvailabilityResponse(TypedDict, total=False): + transportAvailabilityDetails: list[TransportAvailabilityDetails] + transport_availability_details: list[TransportAvailabilityDetails] + + + class azure.mgmt.databox.types.TransportPreferences(TypedDict, total=False): + key "isUpdated": bool + key "preferredShipmentType": Required[Union[str, TransportShipmentTypes]] + is_updated: bool + preferred_shipment_type: Union[str, TransportShipmentTypes] + + + class azure.mgmt.databox.types.UnencryptedCredentials(TypedDict, total=False): + key "jobName": str + key "jobSecrets": ForwardRef('JobSecrets', module='types') + job_name: str + job_secrets: JobSecrets + + + class azure.mgmt.databox.types.UpdateJobDetails(TypedDict, total=False): + key "contactDetails": ForwardRef('ContactDetails', module='types') + key "keyEncryptionKey": ForwardRef('KeyEncryptionKey', module='types') + key "preferences": ForwardRef('Preferences', module='types') + key "returnToCustomerPackageDetails": ForwardRef('PackageCarrierDetails', module='types') + key "reverseShippingDetails": ForwardRef('ReverseShippingDetails', module='types') + key "shippingAddress": ForwardRef('ShippingAddress', module='types') + contact_details: ContactDetails + key_encryption_key: KeyEncryptionKey + preferences: Preferences + return_to_customer_package_details: PackageCarrierDetails + reverse_shipping_details: ReverseShippingDetails + shipping_address: ShippingAddress + + + class azure.mgmt.databox.types.UpdateJobProperties(TypedDict, total=False): + key "details": ForwardRef('UpdateJobDetails', module='types') + details: UpdateJobDetails + + + class azure.mgmt.databox.types.UserAssignedIdentity(TypedDict, total=False): + key "clientId": str + key "principalId": str + client_id: str + principal_id: str + + + class azure.mgmt.databox.types.UserAssignedProperties(TypedDict, total=False): + key "resourceId": str + resource_id: str + + + class azure.mgmt.databox.types.ValidateAddress(TypedDict, total=False): + key "deviceType": Required[Union[str, SkuName]] + key "model": Union[str, ModelName] + key "shippingAddress": Required[ShippingAddress] + key "transportPreferences": ForwardRef('TransportPreferences', module='types') + key "validationType": Required[Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS]] + device_type: Union[str, SkuName] + model: Union[str, ModelName] + shipping_address: ShippingAddress + transport_preferences: TransportPreferences + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS] + + + class azure.mgmt.databox.types.ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + VALIDATE_ADDRESS = "ValidateAddress" + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + VALIDATE_PREFERENCES = "ValidatePreferences" + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + + + class azure.mgmt.databox.types.ValidationRequest(TypedDict, total=False): + key "individualRequestDetails": Required[list[ValidationInputRequest]] + key "validationCategory": Required[Literal["JobCreationValidation"]] + individual_request_details: list[ValidationInputRequest] + validation_category: Literal[JobCreationValidation] + + + class azure.mgmt.databox.types.ValidationResponse(TypedDict, total=False): + key "properties": ForwardRef('ValidationResponseProperties', module='types') + properties: ValidationResponseProperties + + + class azure.mgmt.databox.types.ValidationResponseProperties(TypedDict, total=False): + key "status": Union[str, OverallValidationStatus] + individualResponseDetails: list[ValidationInputResponse] + individual_response_details: list[ValidationInputResponse] + status: Union[str, OverallValidationStatus] + + +``` \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/api.metadata.yml b/sdk/databox/azure-mgmt-databox/api.metadata.yml new file mode 100644 index 000000000000..2d4376f0d1d4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: 683405408bd06ef935b0d505128e591bb3d8d0af0c5f1e9fac1bf9e633c9c634 +parserVersion: 0.3.28 +pythonVersion: 3.13.13 diff --git a/sdk/databox/azure-mgmt-databox/apiview-properties.json b/sdk/databox/azure-mgmt-databox/apiview-properties.json new file mode 100644 index 000000000000..cbf6d2928d7d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/apiview-properties.json @@ -0,0 +1,205 @@ +{ + "CrossLanguagePackageId": "Microsoft.DataBox", + "CrossLanguageDefinitionId": { + "azure.mgmt.databox.models.AccountCredentialDetails": "Microsoft.DataBox.AccountCredentialDetails", + "azure.mgmt.databox.models.AdditionalErrorInfo": "Microsoft.DataBox.AdditionalErrorInfo", + "azure.mgmt.databox.models.AddressValidationOutput": "Microsoft.DataBox.AddressValidationOutput", + "azure.mgmt.databox.models.ValidationInputResponse": "Microsoft.DataBox.ValidationInputResponse", + "azure.mgmt.databox.models.AddressValidationProperties": "Microsoft.DataBox.AddressValidationProperties", + "azure.mgmt.databox.models.ApiError": "Microsoft.DataBox.ApiError", + "azure.mgmt.databox.models.ApplianceNetworkConfiguration": "Microsoft.DataBox.ApplianceNetworkConfiguration", + "azure.mgmt.databox.models.AvailableSkuRequest": "Microsoft.DataBox.AvailableSkuRequest", + "azure.mgmt.databox.models.AzureFileFilterDetails": "Microsoft.DataBox.AzureFileFilterDetails", + "azure.mgmt.databox.models.BlobFilterDetails": "Microsoft.DataBox.BlobFilterDetails", + "azure.mgmt.databox.models.CancellationReason": "Microsoft.DataBox.CancellationReason", + "azure.mgmt.databox.models.CloudError": "Microsoft.DataBox.CloudError", + "azure.mgmt.databox.models.ContactDetails": "Microsoft.DataBox.ContactDetails", + "azure.mgmt.databox.models.ContactInfo": "Microsoft.DataBox.ContactInfo", + "azure.mgmt.databox.models.CopyLogDetails": "Microsoft.DataBox.CopyLogDetails", + "azure.mgmt.databox.models.CopyProgress": "Microsoft.DataBox.CopyProgress", + "azure.mgmt.databox.models.ValidationRequest": "Microsoft.DataBox.ValidationRequest", + "azure.mgmt.databox.models.CreateJobValidations": "Microsoft.DataBox.CreateJobValidations", + "azure.mgmt.databox.models.ValidationInputRequest": "Microsoft.DataBox.ValidationInputRequest", + "azure.mgmt.databox.models.CreateOrderLimitForSubscriptionValidationRequest": "Microsoft.DataBox.CreateOrderLimitForSubscriptionValidationRequest", + "azure.mgmt.databox.models.CreateOrderLimitForSubscriptionValidationResponseProperties": "Microsoft.DataBox.CreateOrderLimitForSubscriptionValidationResponseProperties", + "azure.mgmt.databox.models.JobSecrets": "Microsoft.DataBox.JobSecrets", + "azure.mgmt.databox.models.CustomerDiskJobSecrets": "Microsoft.DataBox.CustomerDiskJobSecrets", + "azure.mgmt.databox.models.DataAccountDetails": "Microsoft.DataBox.DataAccountDetails", + "azure.mgmt.databox.models.DataBoxAccountCopyLogDetails": "Microsoft.DataBox.DataBoxAccountCopyLogDetails", + "azure.mgmt.databox.models.DataBoxCustomerDiskCopyLogDetails": "Microsoft.DataBox.DataBoxCustomerDiskCopyLogDetails", + "azure.mgmt.databox.models.DataBoxCustomerDiskCopyProgress": "Microsoft.DataBox.DataBoxCustomerDiskCopyProgress", + "azure.mgmt.databox.models.JobDetails": "Microsoft.DataBox.JobDetails", + "azure.mgmt.databox.models.DataBoxCustomerDiskJobDetails": "Microsoft.DataBox.DataBoxCustomerDiskJobDetails", + "azure.mgmt.databox.models.DataBoxDiskCopyLogDetails": "Microsoft.DataBox.DataBoxDiskCopyLogDetails", + "azure.mgmt.databox.models.DataBoxDiskCopyProgress": "Microsoft.DataBox.DataBoxDiskCopyProgress", + "azure.mgmt.databox.models.GranularCopyLogDetails": "Microsoft.DataBox.GranularCopyLogDetails", + "azure.mgmt.databox.models.DataBoxDiskGranularCopyLogDetails": "Microsoft.DataBox.DataBoxDiskGranularCopyLogDetails", + "azure.mgmt.databox.models.GranularCopyProgress": "Microsoft.DataBox.GranularCopyProgress", + "azure.mgmt.databox.models.DataBoxDiskGranularCopyProgress": "Microsoft.DataBox.DataBoxDiskGranularCopyProgress", + "azure.mgmt.databox.models.DataBoxDiskJobDetails": "Microsoft.DataBox.DataBoxDiskJobDetails", + "azure.mgmt.databox.models.DataBoxDiskJobSecrets": "Microsoft.DataBox.DataBoxDiskJobSecrets", + "azure.mgmt.databox.models.DataBoxHeavyAccountCopyLogDetails": "Microsoft.DataBox.DataBoxHeavyAccountCopyLogDetails", + "azure.mgmt.databox.models.DataBoxHeavyJobDetails": "Microsoft.DataBox.DataBoxHeavyJobDetails", + "azure.mgmt.databox.models.DataBoxHeavyJobSecrets": "Microsoft.DataBox.DataBoxHeavyJobSecrets", + "azure.mgmt.databox.models.DataBoxHeavySecret": "Microsoft.DataBox.DataBoxHeavySecret", + "azure.mgmt.databox.models.DataBoxJobDetails": "Microsoft.DataBox.DataBoxJobDetails", + "azure.mgmt.databox.models.DataboxJobSecrets": "Microsoft.DataBox.DataboxJobSecrets", + "azure.mgmt.databox.models.ScheduleAvailabilityRequest": "Microsoft.DataBox.ScheduleAvailabilityRequest", + "azure.mgmt.databox.models.DataBoxScheduleAvailabilityRequest": "Microsoft.DataBox.DataBoxScheduleAvailabilityRequest", + "azure.mgmt.databox.models.DataBoxSecret": "Microsoft.DataBox.DataBoxSecret", + "azure.mgmt.databox.models.DatacenterAddressResponse": "Microsoft.DataBox.DatacenterAddressResponse", + "azure.mgmt.databox.models.DatacenterAddressInstructionResponse": "Microsoft.DataBox.DatacenterAddressInstructionResponse", + "azure.mgmt.databox.models.DatacenterAddressLocationResponse": "Microsoft.DataBox.DatacenterAddressLocationResponse", + "azure.mgmt.databox.models.DatacenterAddressRequest": "Microsoft.DataBox.DatacenterAddressRequest", + "azure.mgmt.databox.models.DataExportDetails": "Microsoft.DataBox.DataExportDetails", + "azure.mgmt.databox.models.DataImportDetails": "Microsoft.DataBox.DataImportDetails", + "azure.mgmt.databox.models.DataLocationToServiceLocationMap": "Microsoft.DataBox.DataLocationToServiceLocationMap", + "azure.mgmt.databox.models.DataTransferDetailsValidationRequest": "Microsoft.DataBox.DataTransferDetailsValidationRequest", + "azure.mgmt.databox.models.DataTransferDetailsValidationResponseProperties": "Microsoft.DataBox.DataTransferDetailsValidationResponseProperties", + "azure.mgmt.databox.models.DcAccessSecurityCode": "Microsoft.DataBox.DcAccessSecurityCode", + "azure.mgmt.databox.models.Details": "Microsoft.DataBox.Details", + "azure.mgmt.databox.models.DeviceCapabilityDetails": "Microsoft.DataBox.DeviceCapabilityDetails", + "azure.mgmt.databox.models.DeviceCapabilityRequest": "Microsoft.DataBox.DeviceCapabilityRequest", + "azure.mgmt.databox.models.DeviceCapabilityResponse": "Microsoft.DataBox.DeviceCapabilityResponse", + "azure.mgmt.databox.models.DeviceErasureDetails": "Microsoft.DataBox.DeviceErasureDetails", + "azure.mgmt.databox.models.DiskScheduleAvailabilityRequest": "Microsoft.DataBox.DiskScheduleAvailabilityRequest", + "azure.mgmt.databox.models.DiskSecret": "Microsoft.DataBox.DiskSecret", + "azure.mgmt.databox.models.EncryptionPreferences": "Microsoft.DataBox.EncryptionPreferences", + "azure.mgmt.databox.models.ErrorDetail": "Microsoft.DataBox.ErrorDetail", + "azure.mgmt.databox.models.ExportDiskDetails": "Microsoft.DataBox.ExportDiskDetails", + "azure.mgmt.databox.models.FilterFileDetails": "Microsoft.DataBox.FilterFileDetails", + "azure.mgmt.databox.models.HeavyScheduleAvailabilityRequest": "Microsoft.DataBox.HeavyScheduleAvailabilityRequest", + "azure.mgmt.databox.models.IdentityProperties": "Microsoft.DataBox.IdentityProperties", + "azure.mgmt.databox.models.ImportDiskDetails": "Microsoft.DataBox.ImportDiskDetails", + "azure.mgmt.databox.models.JobDelayDetails": "Microsoft.DataBox.JobDelayDetails", + "azure.mgmt.databox.models.JobDeliveryInfo": "Microsoft.DataBox.JobDeliveryInfo", + "azure.mgmt.databox.models.JobProperties": "Microsoft.DataBox.JobProperties", + "azure.mgmt.databox.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.databox.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.databox.models.JobResource": "Microsoft.DataBox.JobResource", + "azure.mgmt.databox.models.JobResourceUpdateParameter": "Microsoft.DataBox.JobResourceUpdateParameter", + "azure.mgmt.databox.models.JobStages": "Microsoft.DataBox.JobStages", + "azure.mgmt.databox.models.KeyEncryptionKey": "Microsoft.DataBox.KeyEncryptionKey", + "azure.mgmt.databox.models.LastMitigationActionOnJob": "Microsoft.DataBox.LastMitigationActionOnJob", + "azure.mgmt.databox.models.ManagedDiskDetails": "Microsoft.DataBox.ManagedDiskDetails", + "azure.mgmt.databox.models.MarkDevicesShippedRequest": "Microsoft.DataBox.MarkDevicesShippedRequest", + "azure.mgmt.databox.models.MitigateJobRequest": "Microsoft.DataBox.MitigateJobRequest", + "azure.mgmt.databox.models.NotificationPreference": "Microsoft.DataBox.NotificationPreference", + "azure.mgmt.databox.models.Operation": "Microsoft.DataBox.Operation", + "azure.mgmt.databox.models.OperationDisplay": "Microsoft.DataBox.OperationDisplay", + "azure.mgmt.databox.models.OperationProperties": "Microsoft.DataBox.OperationProperties", + "azure.mgmt.databox.models.PackageCarrierDetails": "Microsoft.DataBox.PackageCarrierDetails", + "azure.mgmt.databox.models.PackageCarrierInfo": "Microsoft.DataBox.PackageCarrierInfo", + "azure.mgmt.databox.models.PackageShippingDetails": "Microsoft.DataBox.PackageShippingDetails", + "azure.mgmt.databox.models.Preferences": "Microsoft.DataBox.Preferences", + "azure.mgmt.databox.models.PreferencesValidationRequest": "Microsoft.DataBox.PreferencesValidationRequest", + "azure.mgmt.databox.models.PreferencesValidationResponseProperties": "Microsoft.DataBox.PreferencesValidationResponseProperties", + "azure.mgmt.databox.models.RegionConfigurationRequest": "Microsoft.DataBox.RegionConfigurationRequest", + "azure.mgmt.databox.models.RegionConfigurationResponse": "Microsoft.DataBox.RegionConfigurationResponse", + "azure.mgmt.databox.models.ResourceIdentity": "Microsoft.DataBox.ResourceIdentity", + "azure.mgmt.databox.models.ReverseShippingDetails": "Microsoft.DataBox.ReverseShippingDetails", + "azure.mgmt.databox.models.ScheduleAvailabilityResponse": "Microsoft.DataBox.ScheduleAvailabilityResponse", + "azure.mgmt.databox.models.ShareCredentialDetails": "Microsoft.DataBox.ShareCredentialDetails", + "azure.mgmt.databox.models.ShipmentPickUpRequest": "Microsoft.DataBox.ShipmentPickUpRequest", + "azure.mgmt.databox.models.ShipmentPickUpResponse": "Microsoft.DataBox.ShipmentPickUpResponse", + "azure.mgmt.databox.models.ShippingAddress": "Microsoft.DataBox.ShippingAddress", + "azure.mgmt.databox.models.Sku": "Microsoft.DataBox.Sku", + "azure.mgmt.databox.models.SkuAvailabilityValidationRequest": "Microsoft.DataBox.SkuAvailabilityValidationRequest", + "azure.mgmt.databox.models.SkuAvailabilityValidationResponseProperties": "Microsoft.DataBox.SkuAvailabilityValidationResponseProperties", + "azure.mgmt.databox.models.SkuCapacity": "Microsoft.DataBox.SkuCapacity", + "azure.mgmt.databox.models.SkuCost": "Microsoft.DataBox.SkuCost", + "azure.mgmt.databox.models.SkuInformation": "Microsoft.DataBox.SkuInformation", + "azure.mgmt.databox.models.SkuProperties": "Microsoft.DataBox.SkuProperties", + "azure.mgmt.databox.models.StorageAccountDetails": "Microsoft.DataBox.StorageAccountDetails", + "azure.mgmt.databox.models.SubscriptionIsAllowedToCreateJobValidationRequest": "Microsoft.DataBox.SubscriptionIsAllowedToCreateJobValidationRequest", + "azure.mgmt.databox.models.SubscriptionIsAllowedToCreateJobValidationResponseProperties": "Microsoft.DataBox.SubscriptionIsAllowedToCreateJobValidationResponseProperties", + "azure.mgmt.databox.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.databox.models.TransferAllDetails": "Microsoft.DataBox.TransferAllDetails", + "azure.mgmt.databox.models.TransferConfiguration": "Microsoft.DataBox.TransferConfiguration", + "azure.mgmt.databox.models.TransferConfigurationTransferAllDetails": "Microsoft.DataBox.TransferConfigurationTransferAllDetails", + "azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails": "Microsoft.DataBox.TransferConfigurationTransferFilterDetails", + "azure.mgmt.databox.models.TransferFilterDetails": "Microsoft.DataBox.TransferFilterDetails", + "azure.mgmt.databox.models.TransportAvailabilityDetails": "Microsoft.DataBox.TransportAvailabilityDetails", + "azure.mgmt.databox.models.TransportAvailabilityRequest": "Microsoft.DataBox.TransportAvailabilityRequest", + "azure.mgmt.databox.models.TransportAvailabilityResponse": "Microsoft.DataBox.TransportAvailabilityResponse", + "azure.mgmt.databox.models.TransportPreferences": "Microsoft.DataBox.TransportPreferences", + "azure.mgmt.databox.models.UnencryptedCredentials": "Microsoft.DataBox.UnencryptedCredentials", + "azure.mgmt.databox.models.UpdateJobDetails": "Microsoft.DataBox.UpdateJobDetails", + "azure.mgmt.databox.models.UpdateJobProperties": "Microsoft.DataBox.UpdateJobProperties", + "azure.mgmt.databox.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "azure.mgmt.databox.models.UserAssignedProperties": "Microsoft.DataBox.UserAssignedProperties", + "azure.mgmt.databox.models.ValidateAddress": "Microsoft.DataBox.ValidateAddress", + "azure.mgmt.databox.models.ValidationResponse": "Microsoft.DataBox.ValidationResponse", + "azure.mgmt.databox.models.ValidationResponseProperties": "Microsoft.DataBox.ValidationResponseProperties", + "azure.mgmt.databox.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.databox.models.TransferType": "Microsoft.DataBox.TransferType", + "azure.mgmt.databox.models.ReverseShippingDetailsEditStatus": "Microsoft.DataBox.ReverseShippingDetailsEditStatus", + "azure.mgmt.databox.models.ReverseTransportPreferenceEditStatus": "Microsoft.DataBox.ReverseTransportPreferenceEditStatus", + "azure.mgmt.databox.models.StageName": "Microsoft.DataBox.StageName", + "azure.mgmt.databox.models.StageStatus": "Microsoft.DataBox.StageStatus", + "azure.mgmt.databox.models.DelayNotificationStatus": "Microsoft.DataBox.DelayNotificationStatus", + "azure.mgmt.databox.models.PortalDelayErrorCode": "Microsoft.DataBox.PortalDelayErrorCode", + "azure.mgmt.databox.models.NotificationStageName": "Microsoft.DataBox.NotificationStageName", + "azure.mgmt.databox.models.AddressType": "Microsoft.DataBox.AddressType", + "azure.mgmt.databox.models.DataAccountType": "Microsoft.DataBox.DataAccountType", + "azure.mgmt.databox.models.LogCollectionLevel": "Microsoft.DataBox.LogCollectionLevel", + "azure.mgmt.databox.models.TransferConfigurationType": "Microsoft.DataBox.TransferConfigurationType", + "azure.mgmt.databox.models.FilterFileType": "Microsoft.DataBox.FilterFileType", + "azure.mgmt.databox.models.ClassDiscriminator": "Microsoft.DataBox.ClassDiscriminator", + "azure.mgmt.databox.models.TransportShipmentTypes": "Microsoft.DataBox.TransportShipmentTypes", + "azure.mgmt.databox.models.DoubleEncryption": "Microsoft.DataBox.DoubleEncryption", + "azure.mgmt.databox.models.HardwareEncryption": "Microsoft.DataBox.HardwareEncryption", + "azure.mgmt.databox.models.KekType": "Microsoft.DataBox.KekType", + "azure.mgmt.databox.models.CustomerResolutionCode": "Microsoft.DataBox.CustomerResolutionCode", + "azure.mgmt.databox.models.DatacenterAddressType": "Microsoft.DataBox.DatacenterAddressType", + "azure.mgmt.databox.models.DataCenterCode": "Microsoft.DataBox.DataCenterCode", + "azure.mgmt.databox.models.CopyStatus": "Microsoft.DataBox.CopyStatus", + "azure.mgmt.databox.models.JobDeliveryType": "Microsoft.DataBox.JobDeliveryType", + "azure.mgmt.databox.models.SkuName": "Microsoft.DataBox.SkuName", + "azure.mgmt.databox.models.ModelName": "Microsoft.DataBox.ModelName", + "azure.mgmt.databox.models.ShareDestinationFormatType": "Microsoft.DataBox.ShareDestinationFormatType", + "azure.mgmt.databox.models.AccessProtocol": "Microsoft.DataBox.AccessProtocol", + "azure.mgmt.databox.models.ValidationInputDiscriminator": "Microsoft.DataBox.ValidationInputDiscriminator", + "azure.mgmt.databox.models.ValidationStatus": "Microsoft.DataBox.ValidationStatus", + "azure.mgmt.databox.models.AddressValidationStatus": "Microsoft.DataBox.AddressValidationStatus", + "azure.mgmt.databox.models.OverallValidationStatus": "Microsoft.DataBox.OverallValidationStatus", + "azure.mgmt.databox.models.SkuDisabledReason": "Microsoft.DataBox.SkuDisabledReason", + "azure.mgmt.databox.operations.Operations.list": "Microsoft.DataBox.Operations.list", + "azure.mgmt.databox.aio.operations.Operations.list": "Microsoft.DataBox.Operations.list", + "azure.mgmt.databox.operations.JobsOperations.get": "Microsoft.DataBox.JobResources.get", + "azure.mgmt.databox.aio.operations.JobsOperations.get": "Microsoft.DataBox.JobResources.get", + "azure.mgmt.databox.operations.JobsOperations.begin_create": "Microsoft.DataBox.JobResources.create", + "azure.mgmt.databox.aio.operations.JobsOperations.begin_create": "Microsoft.DataBox.JobResources.create", + "azure.mgmt.databox.operations.JobsOperations.begin_update": "Microsoft.DataBox.JobResources.update", + "azure.mgmt.databox.aio.operations.JobsOperations.begin_update": "Microsoft.DataBox.JobResources.update", + "azure.mgmt.databox.operations.JobsOperations.begin_delete": "Microsoft.DataBox.JobResources.delete", + "azure.mgmt.databox.aio.operations.JobsOperations.begin_delete": "Microsoft.DataBox.JobResources.delete", + "azure.mgmt.databox.operations.JobsOperations.list_by_resource_group": "Microsoft.DataBox.JobResources.listByResourceGroup", + "azure.mgmt.databox.aio.operations.JobsOperations.list_by_resource_group": "Microsoft.DataBox.JobResources.listByResourceGroup", + "azure.mgmt.databox.operations.JobsOperations.list": "Microsoft.DataBox.JobResources.list", + "azure.mgmt.databox.aio.operations.JobsOperations.list": "Microsoft.DataBox.JobResources.list", + "azure.mgmt.databox.operations.JobsOperations.book_shipment_pick_up": "Microsoft.DataBox.JobResources.bookShipmentPickUp", + "azure.mgmt.databox.aio.operations.JobsOperations.book_shipment_pick_up": "Microsoft.DataBox.JobResources.bookShipmentPickUp", + "azure.mgmt.databox.operations.JobsOperations.cancel": "Microsoft.DataBox.JobResources.cancel", + "azure.mgmt.databox.aio.operations.JobsOperations.cancel": "Microsoft.DataBox.JobResources.cancel", + "azure.mgmt.databox.operations.JobsOperations.list_credentials": "Microsoft.DataBox.JobResources.listCredentials", + "azure.mgmt.databox.aio.operations.JobsOperations.list_credentials": "Microsoft.DataBox.JobResources.listCredentials", + "azure.mgmt.databox.operations.JobsOperations.mark_devices_shipped": "Microsoft.DataBox.JobResources.markDevicesShipped", + "azure.mgmt.databox.aio.operations.JobsOperations.mark_devices_shipped": "Microsoft.DataBox.JobResources.markDevicesShipped", + "azure.mgmt.databox.operations.ServiceOperations.region_configuration": "Microsoft.DataBox.ServiceOperationGroup.regionConfiguration", + "azure.mgmt.databox.aio.operations.ServiceOperations.region_configuration": "Microsoft.DataBox.ServiceOperationGroup.regionConfiguration", + "azure.mgmt.databox.operations.ServiceOperations.validate_address": "Microsoft.DataBox.ServiceOperationGroup.validateAddress", + "azure.mgmt.databox.aio.operations.ServiceOperations.validate_address": "Microsoft.DataBox.ServiceOperationGroup.validateAddress", + "azure.mgmt.databox.operations.ServiceOperations.validate_inputs": "Microsoft.DataBox.ServiceOperationGroup.validateInputs", + "azure.mgmt.databox.aio.operations.ServiceOperations.validate_inputs": "Microsoft.DataBox.ServiceOperationGroup.validateInputs", + "azure.mgmt.databox.operations.ServiceOperations.list_available_skus_by_resource_group": "Microsoft.DataBox.ServiceOperationGroup.listAvailableSkusByResourceGroup", + "azure.mgmt.databox.aio.operations.ServiceOperations.list_available_skus_by_resource_group": "Microsoft.DataBox.ServiceOperationGroup.listAvailableSkusByResourceGroup", + "azure.mgmt.databox.operations.ServiceOperations.region_configuration_by_resource_group": "Microsoft.DataBox.ServiceOperationGroup.regionConfigurationByResourceGroup", + "azure.mgmt.databox.aio.operations.ServiceOperations.region_configuration_by_resource_group": "Microsoft.DataBox.ServiceOperationGroup.regionConfigurationByResourceGroup", + "azure.mgmt.databox.operations.ServiceOperations.validate_inputs_by_resource_group": "Microsoft.DataBox.ServiceOperationGroup.validateInputsByResourceGroup", + "azure.mgmt.databox.aio.operations.ServiceOperations.validate_inputs_by_resource_group": "Microsoft.DataBox.ServiceOperationGroup.validateInputsByResourceGroup", + "azure.mgmt.databox.DataBoxManagementClient.mitigate": "Microsoft.DataBox.mitigate", + "azure.mgmt.databox.aio.DataBoxManagementClient.mitigate": "Microsoft.DataBox.mitigate" + }, + "CrossLanguageVersion": "22b0e520823b" +} \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/__init__.py b/sdk/databox/azure-mgmt-databox/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/databox/azure-mgmt-databox/azure/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/__init__.py index 80a1f3c3f55a..5a5181fdd18e 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._data_box_management_client import DataBoxManagementClient # type: ignore +from ._client import DataBoxManagementClient # type: ignore from ._version import VERSION __version__ = VERSION diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_client.py similarity index 62% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_data_box_management_client.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_client.py index 15fb1aa16cd1..5b4e74e934d6 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_client.py @@ -2,30 +2,37 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING -from typing_extensions import Self +import sys +from typing import Any, Optional, TYPE_CHECKING, cast from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints -from . import models as _models from ._configuration import DataBoxManagementClientConfiguration -from ._serialization import Deserializer, Serializer -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations +from ._utils.serialization import Deserializer, Serializer +from .operations import JobsOperations, Operations, ServiceOperations, _DataBoxManagementClientOperationsMixin + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class DataBoxManagementClient(DataBoxManagementClientOperationsMixin): - """The DataBox Client. +class DataBoxManagementClient(_DataBoxManagementClientOperationsMixin): + """DataBoxManagementClient. :ivar operations: Operations operations :vartype operations: azure.mgmt.databox.operations.Operations @@ -33,14 +40,18 @@ class DataBoxManagementClient(DataBoxManagementClientOperationsMixin): :vartype jobs: azure.mgmt.databox.operations.JobsOperations :ivar service: ServiceOperations operations :vartype service: azure.mgmt.databox.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this - default value may result in unsupported behavior. + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-07-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -50,12 +61,26 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -74,23 +99,22 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **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._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = client._send_request(request) + >>> response = client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -103,7 +127,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py index 089fb44c0ef3..bb66eb9d0577 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -14,6 +14,7 @@ from ._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -23,17 +24,30 @@ class DataBoxManagementClientConfiguration: # pylint: disable=too-many-instance 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. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this - default value may result in unsupported behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-07-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2025-02-01") + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2025-07-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -42,6 +56,8 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-databox/{}".format(VERSION)) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_patch.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/model_base.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/model_base.py new file mode 100644 index 000000000000..b93f5120d517 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/model_base.py @@ -0,0 +1,1770 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null + +from azure.core.rest import HttpResponse + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") +_NONE_TYPE = type(None) + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj # type: ignore[no-any-return] + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) # type: ignore[no-any-return] + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _serialize_duration(o, format) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass: dict[str, typing.Any] = {} + if args: + if isinstance(args[0], ET.Element): + dict_to_pass.update(self._init_from_xml(args[0])) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) + super().__init__(dict_to_pass) + + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value.text if isinstance(value, ET.Element) else value) + except ValueError: + # for unknown value, return raw value + return value.text if isinstance(value, ET.Element) else value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +# pylint: disable=too-many-instance-attributes +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._is_optional = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + self._deserializer = deserializer + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None + if item is None: + return item + if self._is_model: + return item + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized + + def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + deserializer=deserializer, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) + wrapped_element = _create_xml_element( + element_name, + model_meta.get("prefix"), + _model_ns, + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + _set_xml_attribute(wrapped_element, k, v, prop_meta) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": _dict_ns, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": _items_ns, + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[dict[str, typing.Any]], +) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element # type: ignore[no-any-return] + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + _safe_register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_serialization.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/serialization.py similarity index 88% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_serialization.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/serialization.py index b24ab2885450..75906e2eb77f 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_serialization.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/serialization.py @@ -1,28 +1,10 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pyright: reportUnnecessaryTypeIgnoreComment=false @@ -39,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -48,10 +29,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, - List, ) try: @@ -65,9 +43,13 @@ from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -185,73 +167,7 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0. - - :param datetime.datetime dt: The datetime - :returns: The offset - :rtype: datetime.timedelta - """ - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation. - - :param datetime.datetime dt: The datetime - :returns: The timestamp representation - :rtype: str - """ - return "Z" - - def dst(self, dt): - """No daylight saving for UTC. - - :param datetime.datetime dt: The datetime - :returns: The daylight saving time - :rtype: datetime.timedelta - """ - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset) -> None: - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -397,7 +313,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -450,25 +366,25 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -479,8 +395,8 @@ def from_dict( :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -500,7 +416,7 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -604,6 +520,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -614,7 +534,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -626,7 +546,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) @@ -665,7 +585,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -736,8 +656,8 @@ def body(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized request body """ @@ -781,8 +701,8 @@ def url(self, name, data, data_type, **kwargs): :param str data_type: The type to be serialized from. :rtype: str :returns: The serialized URL path - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -805,8 +725,8 @@ def query(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized query parameter """ try: @@ -835,8 +755,8 @@ def header(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized header """ try: @@ -855,9 +775,9 @@ def serialize_data(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. :returns: The serialized data. :rtype: str, int, float, bool, dict, list """ @@ -875,7 +795,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -909,13 +829,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1186,13 +1113,68 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. :return: serialized rfc """ try: @@ -1218,7 +1200,7 @@ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. :return: serialized iso """ if isinstance(attr, str): @@ -1251,7 +1233,7 @@ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid :return: serialied unix """ if isinstance(attr, int): @@ -1270,7 +1252,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1429,7 +1411,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument # Iter and wrapped, should have found one node only (the wrap one) if len(children) != 1: raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( xml_name ) ) @@ -1458,6 +1440,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1470,9 +1456,13 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1482,16 +1472,37 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1502,7 +1513,7 @@ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1717,7 +1728,7 @@ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return- :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1799,7 +1810,7 @@ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return :param dict attr: Dictionary to be deserialized. :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1845,7 +1856,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1871,7 +1882,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): @@ -1936,7 +1951,7 @@ def deserialize_bytearray(attr): :param str attr: response string to be deserialized. :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1949,7 +1964,7 @@ def deserialize_base64(attr): :param str attr: response string to be deserialized. :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1964,7 +1979,7 @@ def deserialize_decimal(attr): :param str attr: response string to be deserialized. :return: Deserialized decimal - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. :rtype: decimal """ if isinstance(attr, ET.Element): @@ -1982,7 +1997,7 @@ def deserialize_long(attr): :param str attr: response string to be deserialized. :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1995,7 +2010,7 @@ def deserialize_duration(attr): :param str attr: response string to be deserialized. :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2006,6 +2021,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. @@ -2013,7 +2070,7 @@ def deserialize_date(attr): :param str attr: response string to be deserialized. :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2029,7 +2086,7 @@ def deserialize_time(attr): :param str attr: response string to be deserialized. :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2044,14 +2101,14 @@ def deserialize_rfc(attr): :param str attr: response string to be deserialized. :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) @@ -2067,7 +2124,7 @@ def deserialize_iso(attr): :param str attr: response string to be deserialized. :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2105,7 +2162,7 @@ def deserialize_unix(attr): :param int attr: Object to be serialized. :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/utils.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/utils.py new file mode 100644 index 000000000000..927adb7c8ae2 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_utils/utils.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import Generic, Optional, TYPE_CHECKING, TypeVar + +from azure.core import MatchConditions + +if TYPE_CHECKING: + from .serialization import Deserializer, Serializer + + +TClient = TypeVar("TClient") +TConfig = TypeVar("TConfig") + + +class ClientMixinABC(ABC, Generic[TClient, TConfig]): + """DO NOT use this class. It is for internal typing use only.""" + + _client: TClient + _config: TConfig + _serialize: "Serializer" + _deserialize: "Deserializer" + + +def quote_etag(etag: Optional[str]) -> Optional[str]: + if not etag or etag == "*": + return etag + if etag.startswith("W/"): + return etag + if etag.startswith('"') and etag.endswith('"'): + return etag + if etag.startswith("'") and etag.endswith("'"): + return etag + return '"' + etag + '"' + + +def prep_if_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfNotModified: + if_match = quote_etag(etag) if etag else None + return if_match + if match_condition == MatchConditions.IfPresent: + return "*" + return None + + +def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfModified: + if_none_match = quote_etag(etag) if etag else None + return if_none_match + if match_condition == MatchConditions.IfMissing: + return "*" + return None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_vendor.py deleted file mode 100644 index 77cb1c90bb65..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_vendor.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------- -# 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 abc import ABC -from typing import TYPE_CHECKING - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - from azure.core import PipelineClient - - from ._serialization import Deserializer, Serializer - - -class DataBoxManagementClientMixinABC(ABC): - """DO NOT use this class. It is for internal typing use only.""" - - _client: "PipelineClient" - _config: DataBoxManagementClientConfiguration - _serialize: "Serializer" - _deserialize: "Deserializer" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_version.py index 47babc28d5ed..01341a37742a 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_version.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_version.py @@ -2,8 +2,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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.1.0" +VERSION = "4.0.0b1" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/__init__.py index f6e63b92052f..f85afef26700 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._data_box_management_client import DataBoxManagementClient # type: ignore +from ._client import DataBoxManagementClient # type: ignore try: from ._patch import __all__ as _patch_all diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_client.py similarity index 63% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_data_box_management_client.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_client.py index 87b3f4859c2e..35d112704bc6 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_client.py @@ -2,30 +2,37 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING -from typing_extensions import Self +import sys +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints -from .. import models as _models -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations +from .operations import JobsOperations, Operations, ServiceOperations, _DataBoxManagementClientOperationsMixin + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class DataBoxManagementClient(DataBoxManagementClientOperationsMixin): - """The DataBox Client. +class DataBoxManagementClient(_DataBoxManagementClientOperationsMixin): + """DataBoxManagementClient. :ivar operations: Operations operations :vartype operations: azure.mgmt.databox.aio.operations.Operations @@ -33,14 +40,18 @@ class DataBoxManagementClient(DataBoxManagementClientOperationsMixin): :vartype jobs: azure.mgmt.databox.aio.operations.JobsOperations :ivar service: ServiceOperations operations :vartype service: azure.mgmt.databox.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this - default value may result in unsupported behavior. + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-07-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -50,12 +61,26 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -74,17 +99,18 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **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._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize) - def _send_request( + def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. @@ -92,7 +118,7 @@ def _send_request( >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = await client._send_request(request) + >>> response = await client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -105,7 +131,11 @@ def _send_request( """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_configuration.py index 10d8ee9e5d23..24e42204dfbe 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_configuration.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -14,6 +14,7 @@ from .._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -23,17 +24,30 @@ class DataBoxManagementClientConfiguration: # pylint: disable=too-many-instance 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. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this - default value may result in unsupported behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-07-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2025-02-01") + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2025-07-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -42,6 +56,8 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-databox/{}".format(VERSION)) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_patch.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_vendor.py deleted file mode 100644 index 9f207543d353..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_vendor.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------- -# 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 abc import ABC -from typing import TYPE_CHECKING - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - from azure.core import AsyncPipelineClient - - from .._serialization import Deserializer, Serializer - - -class DataBoxManagementClientMixinABC(ABC): - """DO NOT use this class. It is for internal typing use only.""" - - _client: "AsyncPipelineClient" - _config: DataBoxManagementClientConfiguration - _serialize: "Serializer" - _deserialize: "Deserializer" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/__init__.py index 3e73db476be2..0e7e8ee31d19 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -13,9 +13,9 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore -from ._jobs_operations import JobsOperations # type: ignore -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin # type: ignore -from ._service_operations import ServiceOperations # type: ignore +from ._operations import JobsOperations # type: ignore +from ._operations import ServiceOperations # type: ignore +from ._operations import _DataBoxManagementClientOperationsMixin # type: ignore # pylint: disable=unused-import from ._patch import __all__ as _patch_all from ._patch import * @@ -24,7 +24,6 @@ __all__ = [ "Operations", "JobsOperations", - "DataBoxManagementClientOperationsMixin", "ServiceOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_data_box_management_client_operations.py deleted file mode 100644 index d892e707bc95..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,168 +0,0 @@ -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._data_box_management_client_operations import build_mitigate_request -from .._vendor import DataBoxManagementClientMixinABC - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC): - - @overload - async def mitigate( - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: _models.MitigateJobRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Request to mitigate for a given job. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mitigate_job_request: Mitigation Request. Required. - :type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mitigate( - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Request to mitigate for a given job. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mitigate_job_request: Mitigation Request. Required. - :type mitigate_job_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def mitigate( - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO[bytes]], - **kwargs: Any - ) -> None: - """Request to mitigate for a given job. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a - IO[bytes] type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(mitigate_job_request, (IOBase, bytes)): - _content = mitigate_job_request - else: - _json = self._serialize.body(mitigate_job_request, "MitigateJobRequest") - - _request = build_mitigate_request( - job_name=job_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_jobs_operations.py deleted file mode 100644 index f59b415e8db5..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1303 +0,0 @@ -# pylint: disable=too-many-lines -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._jobs_operations import ( - build_book_shipment_pick_up_request, - build_cancel_request, - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_credentials_request, - build_list_request, - build_mark_devices_shipped_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class JobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.aio.DataBoxManagementClient`'s - :attr:`jobs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, skip_token: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.JobResource"]: - """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. Default value is None. - :type skip_token: str - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - 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) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def mark_devices_shipped( - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: _models.MarkDevicesShippedRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Request to mark devices for a given job as shipped. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mark_devices_shipped_request: Mark Devices Shipped Request. Required. - :type mark_devices_shipped_request: ~azure.mgmt.databox.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mark_devices_shipped( - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Request to mark devices for a given job as shipped. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mark_devices_shipped_request: Mark Devices Shipped Request. Required. - :type mark_devices_shipped_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def mark_devices_shipped( - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: Union[_models.MarkDevicesShippedRequest, IO[bytes]], - **kwargs: Any - ) -> None: - """Request to mark devices for a given job as shipped. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mark_devices_shipped_request: Mark Devices Shipped Request. Is either a - MarkDevicesShippedRequest type or a IO[bytes] type. Required. - :type mark_devices_shipped_request: ~azure.mgmt.databox.models.MarkDevicesShippedRequest or - IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(mark_devices_shipped_request, (IOBase, bytes)): - _content = mark_devices_shipped_request - else: - _json = self._serialize.body(mark_devices_shipped_request, "MarkDevicesShippedRequest") - - _request = build_mark_devices_shipped_request( - job_name=job_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.JobResource"]: - """Lists all the jobs available under the given resource group. - - :param resource_group_name: The Resource Group Name. Required. - :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. Default value is None. - :type skip_token: str - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - 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) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, job_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> _models.JobResource: - """Gets information about the specified job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param expand: $expand is supported on details parameter for job, which provides details on the - job stages. Default value is None. - :type expand: str - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - job_name: str, - job_resource: Union[_models.JobResource, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IOBase, bytes)): - _content = job_resource - else: - _json = self._serialize.body(job_resource, "JobResource") - - _request = build_create_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: _models.JobResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> 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. Required. - :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. - Required. - :type job_name: str - :param job_resource: Job details from request body. Required. - :type job_resource: ~azure.mgmt.databox.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> 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. Required. - :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. - Required. - :type job_name: str - :param job_resource: Job details from request body. Required. - :type job_resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: Union[_models.JobResource, IO[bytes]], - **kwargs: Any - ) -> 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. Required. - :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. - Required. - :type job_name: str - :param job_resource: Job details from request body. Is either a JobResource type or a IO[bytes] - type. Required. - :type job_resource: ~azure.mgmt.databox.models.JobResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - job_name=job_name, - job_resource=job_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.JobResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JobResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Deletes a job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :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: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - job_name=job_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IOBase, bytes)): - _content = job_resource_update_parameter - else: - _json = self._serialize.body(job_resource_update_parameter, "JobResourceUpdateParameter") - - _request = build_update_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: _models.JobResourceUpdateParameter, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JobResource]: - """Updates the properties of an existing job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param job_resource_update_parameter: Job update parameters from request body. Required. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter - :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. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO[bytes], - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JobResource]: - """Updates the properties of an existing job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param job_resource_update_parameter: Job update parameters from request body. Required. - :type job_resource_update_parameter: IO[bytes] - :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. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.JobResource]: - """Updates the properties of an existing job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param job_resource_update_parameter: Job update parameters from request body. Is either a - JobResourceUpdateParameter type or a IO[bytes] type. Required. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter or - IO[bytes] - :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. Default value is None. - :type if_match: str - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - job_name=job_name, - job_resource_update_parameter=job_resource_update_parameter, - if_match=if_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.JobResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JobResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def book_shipment_pick_up( - self, - resource_group_name: str, - job_name: str, - shipment_pick_up_request: _models.ShipmentPickUpRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ShipmentPickUpResponse: - """Book shipment pick up. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param shipment_pick_up_request: Details of shipment pick up request. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def book_shipment_pick_up( - self, - resource_group_name: str, - job_name: str, - shipment_pick_up_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ShipmentPickUpResponse: - """Book shipment pick up. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param shipment_pick_up_request: Details of shipment pick up request. Required. - :type shipment_pick_up_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def book_shipment_pick_up( - self, - resource_group_name: str, - job_name: str, - shipment_pick_up_request: Union[_models.ShipmentPickUpRequest, IO[bytes]], - **kwargs: Any - ) -> _models.ShipmentPickUpResponse: - """Book shipment pick up. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param shipment_pick_up_request: Details of shipment pick up request. Is either a - ShipmentPickUpRequest type or a IO[bytes] type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest or IO[bytes] - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ShipmentPickUpResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(shipment_pick_up_request, (IOBase, bytes)): - _content = shipment_pick_up_request - else: - _json = self._serialize.body(shipment_pick_up_request, "ShipmentPickUpRequest") - - _request = build_book_shipment_pick_up_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def cancel( - self, - resource_group_name: str, - job_name: str, - cancellation_reason: _models.CancellationReason, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """CancelJob. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """CancelJob. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO[bytes]], - **kwargs: Any - ) -> None: - """CancelJob. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO[bytes] type. Required. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cancellation_reason, (IOBase, bytes)): - _content = cancellation_reason - else: - _json = self._serialize.body(cancellation_reason, "CancellationReason") - - _request = build_cancel_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_credentials( - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> AsyncIterable["_models.UnencryptedCredentials"]: - """This method gets the unencrypted secrets related to the job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.UnencryptedCredentials] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_credentials_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - 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) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_operations.py index 88f8b5f73c3e..04d55af3fd93 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_operations.py @@ -1,38 +1,68 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient, MatchConditions from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models -from ...operations._operations import build_list_request +from ... import models as _models, types as _types +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer +from ..._utils.utils import ClientMixinABC +from ...operations._operations import ( + build_data_box_management_mitigate_request, + build_jobs_book_shipment_pick_up_request, + build_jobs_cancel_request, + build_jobs_create_request, + build_jobs_delete_request, + build_jobs_get_request, + build_jobs_list_by_resource_group_request, + build_jobs_list_credentials_request, + build_jobs_list_request, + build_jobs_mark_devices_shipped_request, + build_jobs_update_request, + build_operations_list_request, + build_service_list_available_skus_by_resource_group_request, + build_service_region_configuration_by_resource_group_request, + build_service_region_configuration_request, + build_service_validate_address_request, + build_service_validate_inputs_by_resource_group_request, + build_service_validate_inputs_request, +) +from .._configuration import DataBoxManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +List = list class Operations: @@ -45,28 +75,875 @@ class Operations: :attr:`operations` attribute. """ - models = _models - def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: + """List the operations for the provider. - :return: An iterator like instance of either Operation or the result of cls(response) + :return: An iterator like instance of Operation :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.databox.aio.DataBoxManagementClient`'s + :attr:`jobs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, job_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.JobResource: + """Gets information about the specified job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :keyword expand: $expand is supported on details parameter for job, which provides details on + the job stages. Default value is None. + :paramtype expand: str + :return: JobResource. The JobResource is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + + _request = build_jobs_get_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + job_name: str, + job_resource: Union[_models.JobResource, _types.JobResource, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(job_resource, (IOBase, bytes)): + _content = job_resource + else: + _content = json.dumps(job_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_create_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> 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 name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.models.JobResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns JobResource. The JobResource is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _types.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> 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 name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.types.JobResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns JobResource. The JobResource is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> 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 name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns JobResource. The JobResource is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: Union[_models.JobResource, _types.JobResource, IO[bytes]], + **kwargs: Any + ) -> 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 name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource: Job details from request body. Is either a JobResource type or a IO[bytes] + type. Required. + :type job_resource: ~azure.mgmt.databox.models.JobResource or + ~azure.mgmt.databox.types.JobResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns JobResource. The JobResource is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource=job_resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JobResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: Union[ + _models.JobResourceUpdateParameter, _types.JobResourceUpdateParameter, IO[bytes] + ], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(job_resource_update_parameter, (IOBase, bytes)): + _content = job_resource_update_parameter + else: + _content = json.dumps(job_resource_update_parameter, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_update_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns JobResource. The JobResource is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _types.JobResourceUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: ~azure.mgmt.databox.types.JobResourceUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns JobResource. The JobResource is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns JobResource. The JobResource is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: Union[ + _models.JobResourceUpdateParameter, _types.JobResourceUpdateParameter, IO[bytes] + ], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Is either a + JobResourceUpdateParameter type or a IO[bytes] type. Required. + :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter or + ~azure.mgmt.databox.types.JobResourceUpdateParameter or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns JobResource. The JobResource is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource_update_parameter=job_resource_update_parameter, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JobResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_jobs_delete_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + 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, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword skip_token: $skipToken is supported on Get list of jobs, which provides the next page + in the list of jobs. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of JobResource + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) + cls: ClsType[List[_models.JobResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -79,12 +956,20 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_jobs_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -97,18 +982,29 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -121,9 +1017,1942 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, *, skip_token: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_models.JobResource"]: + """Lists all the jobs available under the subscription. + + :keyword skip_token: $skipToken is supported on Get list of jobs, which provides the next page + in the list of jobs. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of JobResource + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_jobs_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ShipmentPickUpResponse. The ShipmentPickUpResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _types.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.types.ShipmentPickUpRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ShipmentPickUpResponse. The ShipmentPickUpResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ShipmentPickUpResponse. The ShipmentPickUpResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: Union[_models.ShipmentPickUpRequest, _types.ShipmentPickUpRequest, IO[bytes]], + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Is either a + ShipmentPickUpRequest type or a IO[bytes] type. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest or + ~azure.mgmt.databox.types.ShipmentPickUpRequest or IO[bytes] + :return: ShipmentPickUpResponse. The ShipmentPickUpResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ShipmentPickUpResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(shipment_pick_up_request, (IOBase, bytes)): + _content = shipment_pick_up_request + else: + _content = json.dumps(shipment_pick_up_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_book_shipment_pick_up_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ShipmentPickUpResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: _models.CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: _types.CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: ~azure.mgmt.databox.types.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: Union[_models.CancellationReason, _types.CancellationReason, IO[bytes]], + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a + IO[bytes] type. Required. + :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason or + ~azure.mgmt.databox.types.CancellationReason or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(cancellation_reason, (IOBase, bytes)): + _content = cancellation_reason + else: + _content = json.dumps(cancellation_reason, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_cancel_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :return: An iterator like instance of UnencryptedCredentials + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.UnencryptedCredentials] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.UnencryptedCredentials]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_jobs_list_credentials_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.UnencryptedCredentials], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: _models.MarkDevicesShippedRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mark devices for a given job as shipped. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mark_devices_shipped_request: Mark Devices Shipped Request. Required. + :type mark_devices_shipped_request: ~azure.mgmt.databox.models.MarkDevicesShippedRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: _types.MarkDevicesShippedRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mark devices for a given job as shipped. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mark_devices_shipped_request: Mark Devices Shipped Request. Required. + :type mark_devices_shipped_request: ~azure.mgmt.databox.types.MarkDevicesShippedRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mark devices for a given job as shipped. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mark_devices_shipped_request: Mark Devices Shipped Request. Required. + :type mark_devices_shipped_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: Union[ + _models.MarkDevicesShippedRequest, _types.MarkDevicesShippedRequest, IO[bytes] + ], + **kwargs: Any + ) -> None: + """Request to mark devices for a given job as shipped. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mark_devices_shipped_request: Mark Devices Shipped Request. Is either a + MarkDevicesShippedRequest type or a IO[bytes] type. Required. + :type mark_devices_shipped_request: ~azure.mgmt.databox.models.MarkDevicesShippedRequest or + ~azure.mgmt.databox.types.MarkDevicesShippedRequest or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(mark_devices_shipped_request, (IOBase, bytes)): + _content = mark_devices_shipped_request + else: + _content = json.dumps(mark_devices_shipped_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_mark_devices_shipped_request( + job_name=job_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ServiceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.databox.aio.DataBoxManagementClient`'s + :attr:`service` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: The request body. Required. + :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def region_configuration( + self, + location: str, + region_configuration_request: _types.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: The request body. Required. + :type region_configuration_request: ~azure.mgmt.databox.types.RegionConfigurationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def region_configuration( + self, + location: str, + region_configuration_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: The request body. Required. + :type region_configuration_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def region_configuration( + self, + location: str, + region_configuration_request: Union[ + _models.RegionConfigurationRequest, _types.RegionConfigurationRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: The request body. Is either a RegionConfigurationRequest + type or a IO[bytes] type. Required. + :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or + ~azure.mgmt.databox.types.RegionConfigurationRequest or IO[bytes] + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(region_configuration_request, (IOBase, bytes)): + _content = region_configuration_request + else: + _content = json.dumps(region_configuration_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_service_region_configuration_request( + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RegionConfigurationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _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 name of the Azure region. Required. + :type location: str + :param validate_address: The request body. Required. + :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AddressValidationOutput. The AddressValidationOutput is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_address( + self, + location: str, + validate_address: _types.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _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 name of the Azure region. Required. + :type location: str + :param validate_address: The request body. Required. + :type validate_address: ~azure.mgmt.databox.types.ValidateAddress + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AddressValidationOutput. The AddressValidationOutput is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_address( + self, location: str, validate_address: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _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 name of the Azure region. Required. + :type location: str + :param validate_address: The request body. Required. + :type validate_address: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AddressValidationOutput. The AddressValidationOutput is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def validate_address( + self, + location: str, + validate_address: Union[_models.ValidateAddress, _types.ValidateAddress, IO[bytes]], + **kwargs: Any + ) -> _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 name of the Azure region. Required. + :type location: str + :param validate_address: The request body. Is either a ValidateAddress type or a IO[bytes] + type. Required. + :type validate_address: ~azure.mgmt.databox.models.ValidateAddress or + ~azure.mgmt.databox.types.ValidateAddress or IO[bytes] + :return: AddressValidationOutput. The AddressValidationOutput is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressValidationOutput] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(validate_address, (IOBase, bytes)): + _content = validate_address + else: + _content = json.dumps(validate_address, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_service_validate_address_request( + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AddressValidationOutput, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: The request body. Required. + :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_inputs( + self, + location: str, + validation_request: _types.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: The request body. Required. + :type validation_request: ~azure.mgmt.databox.types.ValidationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_inputs( + self, location: str, validation_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: The request body. Required. + :type validation_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def validate_inputs( + self, + location: str, + validation_request: Union[_models.ValidationRequest, _types.ValidationRequest, IO[bytes]], + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: The request body. Is either a ValidationRequest type or a IO[bytes] + type. Required. + :type validation_request: ~azure.mgmt.databox.models.ValidationRequest or + ~azure.mgmt.databox.types.ValidationRequest or IO[bytes] + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(validation_request, (IOBase, bytes)): + _content = validation_request + else: + _content = json.dumps(validation_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_service_validate_inputs_request( + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ValidationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: _models.AvailableSkuRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged["_models.SkuInformation"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param available_sku_request: Filters for showing the available skus. Required. + :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of SkuInformation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: _types.AvailableSkuRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged["_models.SkuInformation"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param available_sku_request: Filters for showing the available skus. Required. + :type available_sku_request: ~azure.mgmt.databox.types.AvailableSkuRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of SkuInformation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged["_models.SkuInformation"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param available_sku_request: Filters for showing the available skus. Required. + :type available_sku_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of SkuInformation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: Union[_models.AvailableSkuRequest, _types.AvailableSkuRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncItemPaged["_models.SkuInformation"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param available_sku_request: Filters for showing the available skus. Is either a + AvailableSkuRequest type or a IO[bytes] type. Required. + :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest or + ~azure.mgmt.databox.types.AvailableSkuRequest or IO[bytes] + :return: An iterator like instance of SkuInformation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[_models.SkuInformation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _content = None + if isinstance(available_sku_request, (IOBase, bytes)): + _content = available_sku_request + else: + _content = json.dumps(available_sku_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + def prepare_request(next_link=None): + if not next_link: + + _request = build_service_list_available_skus_by_resource_group_request( + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SkuInformation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _types.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: ~azure.mgmt.databox.types.RegionConfigurationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: Union[ + _models.RegionConfigurationRequest, _types.RegionConfigurationRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Is either a RegionConfigurationRequest type or a IO[bytes] type. + Required. + :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or + ~azure.mgmt.databox.types.RegionConfigurationRequest or IO[bytes] + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(region_configuration_request, (IOBase, bytes)): + _content = region_configuration_request + else: + _content = json.dumps(region_configuration_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_service_region_configuration_by_resource_group_request( + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RegionConfigurationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _types.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.types.ValidationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: Union[_models.ValidationRequest, _types.ValidationRequest, IO[bytes]], + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Inputs of the customer. Is either a ValidationRequest type or a + IO[bytes] type. Required. + :type validation_request: ~azure.mgmt.databox.models.ValidationRequest or + ~azure.mgmt.databox.types.ValidationRequest or IO[bytes] + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(validation_request, (IOBase, bytes)): + _content = validation_request + else: + _content = json.dumps(validation_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_service_validate_inputs_by_resource_group_request( + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ValidationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class _DataBoxManagementClientOperationsMixin( + ClientMixinABC[AsyncPipelineClient[HttpRequest, AsyncHttpResponse], DataBoxManagementClientConfiguration] +): + + @overload + async def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: _models.MitigateJobRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mitigate for a given job. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. Required. + :type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: _types.MitigateJobRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mitigate for a given job. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. Required. + :type mitigate_job_request: ~azure.mgmt.databox.types.MitigateJobRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mitigate for a given job. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. Required. + :type mitigate_job_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: Union[_models.MitigateJobRequest, _types.MitigateJobRequest, IO[bytes]], + **kwargs: Any + ) -> None: + """Request to mitigate for a given job. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a + IO[bytes] type. Required. + :type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest or + ~azure.mgmt.databox.types.MitigateJobRequest or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(mitigate_job_request, (IOBase, bytes)): + _content = mitigate_job_request + else: + _content = json.dumps(mitigate_job_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_box_management_mitigate_request( + job_name=job_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_patch.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_service_operations.py deleted file mode 100644 index d7d6b908cd02..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_service_operations.py +++ /dev/null @@ -1,830 +0,0 @@ -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._service_operations import ( - build_list_available_skus_by_resource_group_request, - build_region_configuration_by_resource_group_request, - build_region_configuration_request, - build_validate_address_request, - build_validate_inputs_by_resource_group_request, - build_validate_inputs_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ServiceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.aio.DataBoxManagementClient`'s - :attr:`service` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def list_available_skus_by_resource_group( - self, - resource_group_name: str, - location: str, - available_sku_request: _models.AvailableSkuRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription, resource group and - location. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param available_sku_request: Filters for showing the available skus. Required. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_available_skus_by_resource_group( - self, - resource_group_name: str, - location: str, - available_sku_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription, resource group and - location. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param available_sku_request: Filters for showing the available skus. Required. - :type available_sku_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_available_skus_by_resource_group( - self, - resource_group_name: str, - location: str, - available_sku_request: Union[_models.AvailableSkuRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncIterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription, resource group and - location. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param available_sku_request: Filters for showing the available skus. Is either a - AvailableSkuRequest type or a IO[bytes] type. Required. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest or IO[bytes] - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(available_sku_request, (IOBase, bytes)): - _content = available_sku_request - else: - _json = self._serialize.body(available_sku_request, "AvailableSkuRequest") - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_available_skus_by_resource_group_request( - resource_group_name=resource_group_name, - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AvailableSkusResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def validate_address( - self, - location: str, - validate_address: _models.ValidateAddress, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _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. Required. - :type location: str - :param validate_address: Shipping address of the customer. Required. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _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. Required. - :type location: str - :param validate_address: Shipping address of the customer. Required. - :type validate_address: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO[bytes]], **kwargs: Any - ) -> _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. Required. - :type location: str - :param validate_address: Shipping address of the customer. Is either a ValidateAddress type or - a IO[bytes] type. Required. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress or IO[bytes] - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressValidationOutput] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(validate_address, (IOBase, bytes)): - _content = validate_address - else: - _json = self._serialize.body(validate_address, "ValidateAddress") - - _request = build_validate_address_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AddressValidationOutput", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: _models.ValidationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under resource group. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Required. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under resource group. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Required. - :type validation_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: Union[_models.ValidationRequest, IO[bytes]], - **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under resource group. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Is either a ValidationRequest type or a - IO[bytes] type. Required. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest or IO[bytes] - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(validation_request, (IOBase, bytes)): - _content = validation_request - else: - _json = self._serialize.body(validation_request, "ValidationRequest") - - _request = build_validate_inputs_by_resource_group_request( - resource_group_name=resource_group_name, - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def validate_inputs( - self, - location: str, - validation_request: _models.ValidationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under subscription. - - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Required. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs( - self, location: str, validation_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under subscription. - - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Required. - :type validation_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO[bytes]], **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under subscription. - - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Is either a ValidationRequest type or a - IO[bytes] type. Required. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest or IO[bytes] - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(validation_request, (IOBase, bytes)): - _content = validation_request - else: - _json = self._serialize.body(validation_request, "ValidationRequest") - - _request = build_validate_inputs_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def region_configuration( - self, - location: str, - region_configuration_request: _models.RegionConfigurationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Subscription - level. - - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region. - Required. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration( - self, - location: str, - region_configuration_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Subscription - level. - - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region. - Required. - :type region_configuration_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration( - self, - location: str, - region_configuration_request: Union[_models.RegionConfigurationRequest, IO[bytes]], - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Subscription - level. - - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region. Is - either a RegionConfigurationRequest type or a IO[bytes] type. Required. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or - IO[bytes] - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(region_configuration_request, (IOBase, bytes)): - _content = region_configuration_request - else: - _json = self._serialize.body(region_configuration_request, "RegionConfigurationRequest") - - _request = build_region_configuration_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def region_configuration_by_resource_group( - self, - resource_group_name: str, - location: str, - region_configuration_request: _models.RegionConfigurationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Resource group - level. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region at - resource group level. Required. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration_by_resource_group( - self, - resource_group_name: str, - location: str, - region_configuration_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Resource group - level. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region at - resource group level. Required. - :type region_configuration_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration_by_resource_group( - self, - resource_group_name: str, - location: str, - region_configuration_request: Union[_models.RegionConfigurationRequest, IO[bytes]], - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Resource group - level. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region at - resource group level. Is either a RegionConfigurationRequest type or a IO[bytes] type. - Required. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or - IO[bytes] - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(region_configuration_request, (IOBase, bytes)): - _content = region_configuration_request - else: - _json = self._serialize.body(region_configuration_request, "RegionConfigurationRequest") - - _request = build_region_configuration_by_resource_group_request( - resource_group_name=resource_group_name, - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/__init__.py index 9b58e393f8f7..5040c4c24d76 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -13,16 +13,14 @@ from ._patch import * # pylint: disable=unused-wildcard-import -from ._models_py3 import ( # type: ignore +from ._models import ( # type: ignore AccountCredentialDetails, AdditionalErrorInfo, AddressValidationOutput, AddressValidationProperties, ApiError, ApplianceNetworkConfiguration, - ArmBaseObject, AvailableSkuRequest, - AvailableSkusResult, AzureFileFilterDetails, BlobFilterDetails, CancellationReason, @@ -83,8 +81,8 @@ JobDelayDetails, JobDeliveryInfo, JobDetails, + JobProperties, JobResource, - JobResourceList, JobResourceUpdateParameter, JobSecrets, JobStages, @@ -96,7 +94,7 @@ NotificationPreference, Operation, OperationDisplay, - OperationList, + OperationProperties, PackageCarrierDetails, PackageCarrierInfo, PackageShippingDetails, @@ -120,10 +118,12 @@ SkuCapacity, SkuCost, SkuInformation, + SkuProperties, StorageAccountDetails, SubscriptionIsAllowedToCreateJobValidationRequest, SubscriptionIsAllowedToCreateJobValidationResponseProperties, SystemData, + TrackedResource, TransferAllDetails, TransferConfiguration, TransferConfigurationTransferAllDetails, @@ -134,8 +134,8 @@ TransportAvailabilityResponse, TransportPreferences, UnencryptedCredentials, - UnencryptedCredentialsList, UpdateJobDetails, + UpdateJobProperties, UserAssignedIdentity, UserAssignedProperties, ValidateAddress, @@ -143,14 +143,16 @@ ValidationInputResponse, ValidationRequest, ValidationResponse, + ValidationResponseProperties, ) -from ._data_box_management_client_enums import ( # type: ignore +from ._enums import ( # type: ignore AccessProtocol, AddressType, AddressValidationStatus, ClassDiscriminator, CopyStatus, + CreatedByType, CustomerResolutionCode, DataAccountType, DataCenterCode, @@ -190,9 +192,7 @@ "AddressValidationProperties", "ApiError", "ApplianceNetworkConfiguration", - "ArmBaseObject", "AvailableSkuRequest", - "AvailableSkusResult", "AzureFileFilterDetails", "BlobFilterDetails", "CancellationReason", @@ -253,8 +253,8 @@ "JobDelayDetails", "JobDeliveryInfo", "JobDetails", + "JobProperties", "JobResource", - "JobResourceList", "JobResourceUpdateParameter", "JobSecrets", "JobStages", @@ -266,7 +266,7 @@ "NotificationPreference", "Operation", "OperationDisplay", - "OperationList", + "OperationProperties", "PackageCarrierDetails", "PackageCarrierInfo", "PackageShippingDetails", @@ -290,10 +290,12 @@ "SkuCapacity", "SkuCost", "SkuInformation", + "SkuProperties", "StorageAccountDetails", "SubscriptionIsAllowedToCreateJobValidationRequest", "SubscriptionIsAllowedToCreateJobValidationResponseProperties", "SystemData", + "TrackedResource", "TransferAllDetails", "TransferConfiguration", "TransferConfigurationTransferAllDetails", @@ -304,8 +306,8 @@ "TransportAvailabilityResponse", "TransportPreferences", "UnencryptedCredentials", - "UnencryptedCredentialsList", "UpdateJobDetails", + "UpdateJobProperties", "UserAssignedIdentity", "UserAssignedProperties", "ValidateAddress", @@ -313,11 +315,13 @@ "ValidationInputResponse", "ValidationRequest", "ValidationResponse", + "ValidationResponseProperties", "AccessProtocol", "AddressType", "AddressValidationStatus", "ClassDiscriminator", "CopyStatus", + "CreatedByType", "CustomerResolutionCode", "DataAccountType", "DataCenterCode", diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_enums.py similarity index 88% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_data_box_management_client_enums.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_enums.py index 542e536a1106..1edce81e4017 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_data_box_management_client_enums.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_enums.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -11,7 +11,7 @@ class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" + """Access protocols supported on the device.""" SMB = "SMB" """Server Message Block protocol(SMB).""" @@ -95,15 +95,28 @@ class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Copy failed due to modified or removed metadata files.""" +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of entity that created the resource.""" + + USER = "User" + """The entity was created by a user.""" + APPLICATION = "Application" + """The entity was created by an application.""" + MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" + KEY = "Key" + """The entity was created by a key.""" + + class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """CustomerResolutionCode.""" + """Resolution code provided by customer.""" NONE = "None" - """No Resolution Yet""" + """No Resolution Yet.""" MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" - """Clean the device""" + """Clean the device.""" RESUME = "Resume" - """Resume the job to same stage""" + """Resume the job to same stage.""" RESTART = "Restart" """Restart whole action.""" REACH_OUT_TO_OPERATION = "ReachOutToOperation" @@ -132,82 +145,150 @@ class DataCenterCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """DataCenter code.""" INVALID = "Invalid" + """INVALID.""" BY2 = "BY2" + """BY2.""" BY1 = "BY1" + """BY1.""" ORK70 = "ORK70" + """ORK70.""" AM2 = "AM2" + """AM2.""" AMS20 = "AMS20" + """AMS20.""" BY21 = "BY21" + """BY21.""" BY24 = "BY24" + """BY24.""" MWH01 = "MWH01" + """MWH01.""" AMS06 = "AMS06" + """AMS06.""" SSE90 = "SSE90" + """SSE90.""" SYD03 = "SYD03" + """SYD03.""" SYD23 = "SYD23" + """SYD23.""" CBR20 = "CBR20" + """CBR20.""" YTO20 = "YTO20" + """YTO20.""" CWL20 = "CWL20" + """CWL20.""" LON24 = "LON24" + """LON24.""" BOM01 = "BOM01" + """BOM01.""" BL20 = "BL20" + """BL20.""" BL7 = "BL7" + """BL7.""" SEL20 = "SEL20" + """SEL20.""" TYO01 = "TYO01" + """TYO01.""" BN1 = "BN1" + """BN1.""" SN5 = "SN5" + """SN5.""" CYS04 = "CYS04" + """CYS04.""" TYO22 = "TYO22" + """TYO22.""" YTO21 = "YTO21" + """YTO21.""" YQB20 = "YQB20" + """YQB20.""" FRA22 = "FRA22" + """FRA22.""" MAA01 = "MAA01" + """MAA01.""" CPQ02 = "CPQ02" + """CPQ02.""" CPQ20 = "CPQ20" + """CPQ20.""" SIN20 = "SIN20" + """SIN20.""" HKG20 = "HKG20" + """HKG20.""" SG2 = "SG2" + """SG2.""" MEL23 = "MEL23" + """MEL23.""" SEL21 = "SEL21" + """SEL21.""" OSA20 = "OSA20" + """OSA20.""" SHA03 = "SHA03" + """SHA03.""" BJB = "BJB" + """BJB.""" JNB22 = "JNB22" + """JNB22.""" JNB21 = "JNB21" + """JNB21.""" MNZ21 = "MNZ21" + """MNZ21.""" SN8 = "SN8" + """SN8.""" AUH20 = "AUH20" + """AUH20.""" ZRH20 = "ZRH20" + """ZRH20.""" PUS20 = "PUS20" + """PUS20.""" AD_HOC = "AdHoc" + """AD_HOC.""" CH1 = "CH1" + """CH1.""" DSM05 = "DSM05" + """DSM05.""" DUB07 = "DUB07" + """DUB07.""" PNQ01 = "PNQ01" + """PNQ01.""" SVG20 = "SVG20" + """SVG20.""" OSA02 = "OSA02" + """OSA02.""" OSA22 = "OSA22" + """OSA22.""" PAR22 = "PAR22" + """PAR22.""" BN7 = "BN7" + """BN7.""" SN6 = "SN6" + """SN6.""" BJS20 = "BJS20" + """BJS20.""" BL24 = "BL24" + """BL24.""" IDC5 = "IDC5" + """IDC5.""" TYO23 = "TYO23" - CPQ21 = "CPQ21" + """TYO23.""" NTG20 = "NTG20" + """NTG20.""" DXB23 = "DXB23" + """DXB23.""" DSM11 = "DSM11" - OSA23 = "OSA23" + """DSM11.""" AMS25 = "AMS25" + """AMS25.""" + CPQ21 = "CPQ21" + """CPQ21.""" + OSA23 = "OSA23" + """OSA23.""" class DelayNotificationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Status of notification.""" ACTIVE = "Active" - """Delay is still active""" + """Delay is still active.""" RESOLVED = "Resolved" - """Delay has been resolved""" + """Delay has been resolved.""" class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -277,11 +358,11 @@ class ModelName(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATA_BOX_HEAVY = "DataBoxHeavy" """Data Box Heavy.""" DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk""" + """Data Box Customer Disk.""" AZURE_DATA_BOX120 = "AzureDataBox120" - """Data Box V2 with 125TB usable capacity.""" + """Data Box V2 with 120TB usable capacity.""" AZURE_DATA_BOX525 = "AzureDataBox525" - """Data Box V2 with 500TB usable capacity.""" + """Data Box V2 with 525TB usable capacity.""" class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -320,13 +401,13 @@ class PortalDelayErrorCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Delay Error code.""" INTERNAL_ISSUE_DELAY = "InternalIssueDelay" - """Delay due to any internal reasons""" + """Delay due to any internal reasons.""" ACTIVE_ORDER_LIMIT_BREACHED_DELAY = "ActiveOrderLimitBreachedDelay" """Active Order limit breached.""" HIGH_DEMAND_DELAY = "HighDemandDelay" - """High demand""" + """High demand.""" LARGE_NUMBER_OF_FILES_DELAY = "LargeNumberOfFilesDelay" - """Slow copy due to large number of files""" + """Slow copy due to large number of files.""" class ReverseShippingDetailsEditStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -389,7 +470,7 @@ class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" + """SKU names.""" DATA_BOX = "DataBox" """Data Box.""" @@ -398,7 +479,7 @@ class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATA_BOX_HEAVY = "DataBoxHeavy" """Data Box Heavy.""" DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk""" + """Data Box Customer Disk.""" class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -527,8 +608,8 @@ class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Create order limit validation status.""" VALID = "Valid" - """Validation is successful""" + """Validation is successful.""" INVALID = "Invalid" - """Validation is not successful""" + """Validation is not successful.""" SKIPPED = "Skipped" - """Validation is skipped""" + """Validation is skipped.""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_models.py new file mode 100644 index 000000000000..12c5a98dda7e --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_models.py @@ -0,0 +1,5932 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_discriminator, rest_field +from ._enums import ClassDiscriminator, DataAccountType, DatacenterAddressType, SkuName, ValidationInputDiscriminator + +if TYPE_CHECKING: + from .. import models as _models + + +class AccountCredentialDetails(_Model): + """Credential details of the account. + + :ivar account_name: Name of the account. + :vartype account_name: str + :ivar data_account_type: Type of the account. Known values are: "StorageAccount" and + "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.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. + :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] + """ + + account_name: Optional[str] = rest_field(name="accountName", visibility=["read"]) + """Name of the account.""" + data_account_type: Optional[Union[str, "_models.DataAccountType"]] = rest_field( + name="dataAccountType", visibility=["read"] + ) + """Type of the account. Known values are: \"StorageAccount\" and \"ManagedDisk\".""" + account_connection_string: Optional[str] = rest_field(name="accountConnectionString", visibility=["read"]) + """Connection string of the account endpoint to use the account as a storage endpoint on the + device.""" + share_credential_details: Optional[list["_models.ShareCredentialDetails"]] = rest_field( + name="shareCredentialDetails", visibility=["read"] + ) + """Per share level unencrypted access credentials.""" + + +class AdditionalErrorInfo(_Model): + """This class represents additional info which Resource Providers pass when an error occurs. + + :ivar info: Additional information of the type of error. + :vartype info: dict[str, any] + :ivar type: Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation). + :vartype type: str + """ + + info: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional information of the type of error.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation).""" + + @overload + def __init__( + self, + *, + info: Optional[dict[str, Any]] = None, + type: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AddressValidationOutput(_Model): + """Output of the address validation api. + + :ivar properties: The address validation properties. + :vartype properties: ~azure.mgmt.databox.models.AddressValidationProperties + """ + + properties: Optional["_models.AddressValidationProperties"] = rest_field(visibility=["read"]) + """The address validation properties.""" + + __flattened_items = ["error", "validation_status", "alternate_addresses", "validation_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: + AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, + DataTransferDetailsValidationResponseProperties, PreferencesValidationResponseProperties, + SkuAvailabilityValidationResponseProperties, + SubscriptionIsAllowedToCreateJobValidationResponseProperties + + :ivar validation_type: Identifies the type of validation response. Required. Known values are: + "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", + "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.models.CloudError + """ + + __mapping__: dict[str, _Model] = {} + validation_type: str = rest_discriminator( + name="validationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Identifies the type of validation response. Required. Known values are: \"ValidateAddress\", + \"ValidateSubscriptionIsAllowedToCreateJob\", \"ValidatePreferences\", + \"ValidateCreateOrderLimit\", \"ValidateSkuAvailability\", and \"ValidateDataTransferDetails\".""" + error: Optional["_models.CloudError"] = rest_field(visibility=["read"]) + """Error code and message of validation response.""" + + @overload + def __init__( + self, + *, + validation_type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AddressValidationProperties(ValidationInputResponse, discriminator="ValidateAddress"): + """The address validation output. + + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", + and "Ambiguous". + :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :ivar alternate_addresses: List of alternate addresses. + :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response of address validation. + :vartype validation_type: str or ~azure.mgmt.databox.models.VALIDATE_ADDRESS + """ + + validation_status: Optional[Union[str, "_models.AddressValidationStatus"]] = rest_field( + name="validationStatus", visibility=["read"] + ) + """The address validation status. Known values are: \"Valid\", \"Invalid\", and \"Ambiguous\".""" + alternate_addresses: Optional[list["_models.ShippingAddress"]] = rest_field( + name="alternateAddresses", visibility=["read"] + ) + """List of alternate addresses.""" + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation response. Required. Identify request and response of address + validation.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_ADDRESS # type: ignore + + +class ApiError(_Model): + """ApiError. + + :ivar error: The error detail. Required. + :vartype error: ~azure.mgmt.databox.models.ErrorDetail + """ + + error: "_models.ErrorDetail" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error detail. Required.""" + + @overload + def __init__( + self, + *, + error: "_models.ErrorDetail", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ApplianceNetworkConfiguration(_Model): + """The Network Adapter configuration of a DataBox. + + :ivar name: Name of the network. + :vartype name: str + :ivar mac_address: Mac Address. + :vartype mac_address: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Name of the network.""" + mac_address: Optional[str] = rest_field(name="macAddress", visibility=["read"]) + """Mac Address.""" + + +class AvailableSkuRequest(_Model): + """The filters for showing the available skus. + + :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType + :ivar country: ISO country code. Country for hardware shipment. For codes check: + `https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + `_. + Required. + :vartype country: str + :ivar location: Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype location: str + :ivar sku_names: Sku Names to filter for available skus. + :vartype sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + """ + + transfer_type: Union[str, "_models.TransferType"] = rest_field( + name="transferType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the transfer. Required. Known values are: \"ImportToAzure\" and \"ExportFromAzure\".""" + country: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """ISO country code. Country for hardware shipment. For codes check: + `https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + `_. + Required.""" + location: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required.""" + sku_names: Optional[list[Union[str, "_models.SkuName"]]] = rest_field( + name="skuNames", visibility=["read", "create", "update", "delete", "query"] + ) + """Sku Names to filter for available skus.""" + + @overload + def __init__( + self, + *, + transfer_type: Union[str, "_models.TransferType"], + country: str, + location: str, + sku_names: Optional[list[Union[str, "_models.SkuName"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AzureFileFilterDetails(_Model): + """Filter details to transfer Azure files. + + :ivar file_prefix_list: Prefix list of the Azure files to be transferred. + :vartype file_prefix_list: list[str] + :ivar file_path_list: List of full path of the files to be transferred. + :vartype file_path_list: list[str] + :ivar file_share_list: List of file shares to be transferred. + :vartype file_share_list: list[str] + """ + + file_prefix_list: Optional[list[str]] = rest_field( + name="filePrefixList", visibility=["read", "create", "update", "delete", "query"] + ) + """Prefix list of the Azure files to be transferred.""" + file_path_list: Optional[list[str]] = rest_field( + name="filePathList", visibility=["read", "create", "update", "delete", "query"] + ) + """List of full path of the files to be transferred.""" + file_share_list: Optional[list[str]] = rest_field( + name="fileShareList", visibility=["read", "create", "update", "delete", "query"] + ) + """List of file shares to be transferred.""" + + @overload + def __init__( + self, + *, + file_prefix_list: Optional[list[str]] = None, + file_path_list: Optional[list[str]] = None, + file_share_list: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BlobFilterDetails(_Model): + """Filter details to transfer Azure Blobs. + + :ivar blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :vartype blob_prefix_list: list[str] + :ivar blob_path_list: List of full path of the blobs to be transferred. + :vartype blob_path_list: list[str] + :ivar container_list: List of blob containers to be transferred. + :vartype container_list: list[str] + """ + + blob_prefix_list: Optional[list[str]] = rest_field( + name="blobPrefixList", visibility=["read", "create", "update", "delete", "query"] + ) + """Prefix list of the Azure blobs to be transferred.""" + blob_path_list: Optional[list[str]] = rest_field( + name="blobPathList", visibility=["read", "create", "update", "delete", "query"] + ) + """List of full path of the blobs to be transferred.""" + container_list: Optional[list[str]] = rest_field( + name="containerList", visibility=["read", "create", "update", "delete", "query"] + ) + """List of blob containers to be transferred.""" + + @overload + def __init__( + self, + *, + blob_prefix_list: Optional[list[str]] = None, + blob_path_list: Optional[list[str]] = None, + container_list: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CancellationReason(_Model): + """Reason for cancellation. + + :ivar reason: Reason for cancellation. Required. + :vartype reason: str + """ + + reason: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Reason for cancellation. Required.""" + + @overload + def __init__( + self, + *, + reason: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CloudError(_Model): + """Provides additional information about an http error response. + + :ivar additional_info: Gets or sets additional error info. + :vartype additional_info: list[~azure.mgmt.databox.models.AdditionalErrorInfo] + :ivar code: Error code. + :vartype code: str + :ivar details: Gets or sets details for the error. + :vartype details: list[~azure.mgmt.databox.models.CloudError] + :ivar message: The error message parsed from the body of the http error response. + :vartype message: str + :ivar target: Gets or sets the target of the error. + :vartype target: str + """ + + additional_info: Optional[list["_models.AdditionalErrorInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """Gets or sets additional error info.""" + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error code.""" + details: Optional[list["_models.CloudError"]] = rest_field(visibility=["read"]) + """Gets or sets details for the error.""" + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error message parsed from the body of the http error response.""" + target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Gets or sets the target of the error.""" + + @overload + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ContactDetails(_Model): + """Contact Details. + + :ivar contact_name: Contact name of the person. Required. + :vartype contact_name: str + :ivar phone: Phone number of the contact person. Required. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + :ivar email_list: List of Email-ids to be notified about job progress. Required. + :vartype email_list: list[str] + :ivar notification_preference: Notification preference for a job stage. + :vartype notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] + """ + + contact_name: str = rest_field(name="contactName", visibility=["read", "create", "update", "delete", "query"]) + """Contact name of the person. Required.""" + phone: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Phone number of the contact person. Required.""" + phone_extension: Optional[str] = rest_field( + name="phoneExtension", visibility=["read", "create", "update", "delete", "query"] + ) + """Phone extension number of the contact person.""" + mobile: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Mobile number of the contact person.""" + email_list: list[str] = rest_field(name="emailList", visibility=["read", "create", "update", "delete", "query"]) + """List of Email-ids to be notified about job progress. Required.""" + notification_preference: Optional[list["_models.NotificationPreference"]] = rest_field( + name="notificationPreference", visibility=["read", "create", "update", "delete", "query"] + ) + """Notification preference for a job stage.""" + + @overload + 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["_models.NotificationPreference"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ContactInfo(_Model): + """Contact Info. + + :ivar contact_name: Contact name of the person. Required. + :vartype contact_name: str + :ivar phone: Phone number of the contact person. Required. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + """ + + contact_name: str = rest_field(name="contactName", visibility=["read", "create", "update", "delete", "query"]) + """Contact name of the person. Required.""" + phone: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Phone number of the contact person. Required.""" + phone_extension: Optional[str] = rest_field( + name="phoneExtension", visibility=["read", "create", "update", "delete", "query"] + ) + """Phone extension number of the contact person.""" + mobile: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Mobile number of the contact person.""" + + @overload + def __init__( + self, + *, + contact_name: str, + phone: str, + phone_extension: Optional[str] = None, + mobile: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CopyLogDetails(_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, DataBoxCustomerDiskCopyLogDetails, DataBoxDiskCopyLogDetails, + DataBoxHeavyAccountCopyLogDetails + + :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: + "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + """ + + __mapping__: dict[str, _Model] = {} + copy_log_details_type: str = rest_discriminator( + name="copyLogDetailsType", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates the type of job details. Required. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + + @overload + def __init__( + self, + *, + copy_log_details_type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CopyProgress(_Model): + """Copy progress. + + :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType + :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and + "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :ivar account_id: Id of the account where the data needs to be uploaded. + :vartype account_id: str + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: int + :ivar total_bytes_to_process: Total amount of data to be processed by the job. + :vartype total_bytes_to_process: int + :ivar files_processed: Number of files processed. + :vartype files_processed: int + :ivar total_files_to_process: Total files to process. + :vartype total_files_to_process: int + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype invalid_files_processed: int + :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: int + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype renamed_container_count: int + :ivar files_errored_out: Number of files which could not be copied. + :vartype files_errored_out: int + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: int + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: int + :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 + :ivar error: Error, if any, in the stage. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] + """ + + storage_account_name: Optional[str] = rest_field(name="storageAccountName", visibility=["read"]) + """Name of the storage account. This will be empty for data account types other than storage + account.""" + transfer_type: Optional[Union[str, "_models.TransferType"]] = rest_field(name="transferType", visibility=["read"]) + """Transfer type of data. Known values are: \"ImportToAzure\" and \"ExportFromAzure\".""" + data_account_type: Optional[Union[str, "_models.DataAccountType"]] = rest_field( + name="dataAccountType", visibility=["read"] + ) + """Data Account Type. Known values are: \"StorageAccount\" and \"ManagedDisk\".""" + account_id: Optional[str] = rest_field(name="accountId", visibility=["read"]) + """Id of the account where the data needs to be uploaded.""" + bytes_processed: Optional[int] = rest_field(name="bytesProcessed", visibility=["read"]) + """To indicate bytes transferred.""" + total_bytes_to_process: Optional[int] = rest_field(name="totalBytesToProcess", visibility=["read"]) + """Total amount of data to be processed by the job.""" + files_processed: Optional[int] = rest_field(name="filesProcessed", visibility=["read"]) + """Number of files processed.""" + total_files_to_process: Optional[int] = rest_field(name="totalFilesToProcess", visibility=["read"]) + """Total files to process.""" + invalid_files_processed: Optional[int] = rest_field(name="invalidFilesProcessed", visibility=["read"]) + """Number of files not adhering to azure naming conventions which were processed by automatic + renaming.""" + invalid_file_bytes_uploaded: Optional[int] = rest_field(name="invalidFileBytesUploaded", visibility=["read"]) + """Total amount of data not adhering to azure naming conventions which were processed by automatic + renaming.""" + renamed_container_count: Optional[int] = rest_field(name="renamedContainerCount", visibility=["read"]) + """Number of folders not adhering to azure naming conventions which were processed by automatic + renaming.""" + files_errored_out: Optional[int] = rest_field(name="filesErroredOut", visibility=["read"]) + """Number of files which could not be copied.""" + directories_errored_out: Optional[int] = rest_field(name="directoriesErroredOut", visibility=["read"]) + """To indicate directories errored out in the job.""" + invalid_directories_processed: Optional[int] = rest_field(name="invalidDirectoriesProcessed", visibility=["read"]) + """To indicate directories renamed.""" + is_enumeration_in_progress: Optional[bool] = rest_field(name="isEnumerationInProgress", visibility=["read"]) + """To indicate if enumeration of data is in progress. Until this is true, the TotalBytesToProcess + may not be valid.""" + error: Optional["_models.CloudError"] = rest_field(visibility=["read"]) + """Error, if any, in the stage.""" + actions: Optional[list[Union[str, "_models.CustomerResolutionCode"]]] = rest_field(visibility=["read"]) + """Available actions on the job.""" + + +class ValidationRequest(_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 + + :ivar validation_category: Identify the nature of validation. Required. Default value is + "JobCreationValidation". + :vartype validation_category: str + :ivar individual_request_details: List of request details contain validationType and its + request as key and value respectively. Required. + :vartype individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + """ + + __mapping__: dict[str, _Model] = {} + validation_category: Literal["JobCreationValidation"] = rest_discriminator(name="validationCategory", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identify the nature of validation. Required. Default value is \"JobCreationValidation\".""" + individual_request_details: list["_models.ValidationInputRequest"] = rest_field( + name="individualRequestDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """List of request details contain validationType and its request as key and value respectively. + Required.""" + + @overload + def __init__( + self, + *, + individual_request_details: list["_models.ValidationInputRequest"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_category = "JobCreationValidation" # type: ignore + + +class CreateJobValidations(ValidationRequest, discriminator="JobCreationValidation"): + """It does all pre-job creation validations. + + :ivar individual_request_details: List of request details contain validationType and its + request as key and value respectively. Required. + :vartype individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :ivar validation_category: Identify the nature of validation. Required. Default value is + "JobCreationValidation". + :vartype validation_category: str + """ + + @overload + def __init__( + self, + *, + individual_request_details: list["_models.ValidationInputRequest"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ValidationInputRequest(_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: + ValidateAddress, CreateOrderLimitForSubscriptionValidationRequest, + DataTransferDetailsValidationRequest, PreferencesValidationRequest, + SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest + + :ivar validation_type: Identifies the type of validation request. Required. Known values are: + "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", + "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + """ + + __mapping__: dict[str, _Model] = {} + validation_type: str = rest_discriminator( + name="validationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Identifies the type of validation request. Required. Known values are: \"ValidateAddress\", + \"ValidateSubscriptionIsAllowedToCreateJob\", \"ValidatePreferences\", + \"ValidateCreateOrderLimit\", \"ValidateSkuAvailability\", and \"ValidateDataTransferDetails\".""" + + @overload + def __init__( + self, + *, + validation_type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CreateOrderLimitForSubscriptionValidationRequest( + ValidationInputRequest, discriminator="ValidateCreateOrderLimit" +): # pylint: disable=name-too-long + """Request to validate create order limit for current subscription. + + :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", + "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype device_type: str or ~azure.mgmt.databox.models.SkuName + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response of create order limit for subscription validation. + :vartype validation_type: str or ~azure.mgmt.databox.models.VALIDATE_CREATE_ORDER_LIMIT + """ + + device_type: Union[str, "_models.SkuName"] = rest_field( + name="deviceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Device type to be used for the job. Required. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + model: Optional[Union[str, "_models.ModelName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation request. Required. Identify request and response of create + order limit for subscription validation.""" + + @overload + def __init__( + self, + *, + device_type: Union[str, "_models.SkuName"], + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT # type: ignore + + +class CreateOrderLimitForSubscriptionValidationResponseProperties( + ValidationInputResponse, discriminator="ValidateCreateOrderLimit" +): # pylint: disable=name-too-long + """Properties of create order limit for subscription validation response. + + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and + "Skipped". + :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response of create order limit for subscription validation. + :vartype validation_type: str or ~azure.mgmt.databox.models.VALIDATE_CREATE_ORDER_LIMIT + """ + + status: Optional[Union[str, "_models.ValidationStatus"]] = rest_field(visibility=["read"]) + """Create order limit validation status. Known values are: \"Valid\", \"Invalid\", and + \"Skipped\".""" + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation response. Required. Identify request and response of create + order limit for subscription validation.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT # type: ignore + + +class JobSecrets(_Model): + """The base class for the secrets. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + DataboxJobSecrets, CustomerDiskJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets + + :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known + values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~azure.mgmt.databox.models.CloudError + """ + + __mapping__: dict[str, _Model] = {} + job_secrets_type: str = rest_discriminator( + name="jobSecretsType", visibility=["read", "create", "update", "delete", "query"] + ) + """Used to indicate what type of job secrets object. Required. Known values are: \"DataBox\", + \"DataBoxDisk\", \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + dc_access_security_code: Optional["_models.DcAccessSecurityCode"] = rest_field( + name="dcAccessSecurityCode", visibility=["read"] + ) + """Dc Access Security Code for Customer Managed Shipping.""" + error: Optional["_models.CloudError"] = rest_field(visibility=["read"]) + """Error while fetching the secrets.""" + + @overload + def __init__( + self, + *, + job_secrets_type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CustomerDiskJobSecrets(JobSecrets, discriminator="DataBoxCustomerDisk"): + """The secrets related to customer disk job. + + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar disk_secrets: Contains the list of secrets object for that device. + :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] + :ivar carrier_account_number: Carrier Account Number of the customer. + :vartype carrier_account_number: str + :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Data Box + Customer Disk orders. + :vartype job_secrets_type: str or ~azure.mgmt.databox.models.DATA_BOX_CUSTOMER_DISK + """ + + disk_secrets: Optional[list["_models.DiskSecret"]] = rest_field(name="diskSecrets", visibility=["read"]) + """Contains the list of secrets object for that device.""" + carrier_account_number: Optional[str] = rest_field(name="carrierAccountNumber", visibility=["read"]) + """Carrier Account Number of the customer.""" + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] = rest_discriminator(name="jobSecretsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Used to indicate what type of job secrets object. Required. Data Box Customer Disk orders.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_secrets_type = ClassDiscriminator.DATA_BOX_CUSTOMER_DISK # type: ignore + + +class DataAccountDetails(_Model): + """Account details of the data to be transferred. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ManagedDiskDetails, StorageAccountDetails + + :ivar data_account_type: Account Type of the data to be transferred. Required. Known values + are: "StorageAccount" and "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :ivar 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 : @#\\-$%^!+=;:_()]+. + :vartype share_password: str + """ + + __mapping__: dict[str, _Model] = {} + data_account_type: str = rest_discriminator( + name="dataAccountType", visibility=["read", "create", "update", "delete", "query"] + ) + """Account Type of the data to be transferred. Required. Known values are: \"StorageAccount\" and + \"ManagedDisk\".""" + share_password: Optional[str] = rest_field(name="sharePassword", visibility=["create"]) + """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 : @#\\-$%^!+=;:_()]+.""" + + @overload + def __init__( + self, + *, + data_account_type: str, + share_password: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataBoxAccountCopyLogDetails(CopyLogDetails, discriminator="DataBox"): + """Copy log details for a storage account of a DataBox job. + + :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 + :ivar copy_log_details_type: Indicates the type of job details. Required. Data Box orders. + :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.DATA_BOX + """ + + account_name: Optional[str] = rest_field(name="accountName", visibility=["read"]) + """Account name.""" + copy_log_link: Optional[str] = rest_field(name="copyLogLink", visibility=["read"]) + """Link for copy logs.""" + copy_verbose_log_link: Optional[str] = rest_field(name="copyVerboseLogLink", visibility=["read"]) + """Link for copy verbose logs. This will be set only when LogCollectionLevel is set to Verbose.""" + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX] = rest_discriminator(name="copyLogDetailsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Indicates the type of job details. Required. Data Box orders.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.copy_log_details_type = ClassDiscriminator.DATA_BOX # type: ignore + + +class DataBoxCustomerDiskCopyLogDetails(CopyLogDetails, discriminator="DataBoxCustomerDisk"): + """Copy Log Details for customer disk. + + :ivar serial_number: Disk Serial Number. + :vartype serial_number: str + :ivar error_log_link: Link for copy error logs. + :vartype error_log_link: str + :ivar verbose_log_link: Link for copy verbose logs. + :vartype verbose_log_link: str + :ivar copy_log_details_type: Indicates the type of job details. Required. Data Box Customer + Disk orders. + :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.DATA_BOX_CUSTOMER_DISK + """ + + serial_number: Optional[str] = rest_field(name="serialNumber", visibility=["read"]) + """Disk Serial Number.""" + error_log_link: Optional[str] = rest_field(name="errorLogLink", visibility=["read"]) + """Link for copy error logs.""" + verbose_log_link: Optional[str] = rest_field(name="verboseLogLink", visibility=["read"]) + """Link for copy verbose logs.""" + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] = rest_discriminator(name="copyLogDetailsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Indicates the type of job details. Required. Data Box Customer Disk orders.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.copy_log_details_type = ClassDiscriminator.DATA_BOX_CUSTOMER_DISK # type: ignore + + +class DataBoxCustomerDiskCopyProgress(CopyProgress): + """DataBox CustomerDisk Copy Progress. + + :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType + :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and + "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :ivar account_id: Id of the account where the data needs to be uploaded. + :vartype account_id: str + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: int + :ivar total_bytes_to_process: Total amount of data to be processed by the job. + :vartype total_bytes_to_process: int + :ivar files_processed: Number of files processed. + :vartype files_processed: int + :ivar total_files_to_process: Total files to process. + :vartype total_files_to_process: int + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype invalid_files_processed: int + :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: int + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype renamed_container_count: int + :ivar files_errored_out: Number of files which could not be copied. + :vartype files_errored_out: int + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: int + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: int + :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 + :ivar error: Error, if any, in the stage. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] + :ivar serial_number: Disk Serial Number. + :vartype serial_number: str + :ivar copy_status: The Status of the copy. Known values are: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", + "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", + "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". + :vartype copy_status: str or ~azure.mgmt.databox.models.CopyStatus + """ + + serial_number: Optional[str] = rest_field(name="serialNumber", visibility=["read"]) + """Disk Serial Number.""" + copy_status: Optional[Union[str, "_models.CopyStatus"]] = rest_field(name="copyStatus", visibility=["read"]) + """The Status of the copy. Known values are: \"NotStarted\", \"InProgress\", \"Completed\", + \"CompletedWithErrors\", \"Failed\", \"NotReturned\", \"HardwareError\", \"DeviceFormatted\", + \"DeviceMetadataModified\", \"StorageAccountNotAccessible\", \"UnsupportedData\", + \"DriveNotReceived\", \"UnsupportedDrive\", \"OtherServiceError\", \"OtherUserError\", + \"DriveNotDetected\", \"DriveCorrupted\", and \"MetadataFilesModifiedOrRemoved\".""" + + +class JobDetails(_Model): + """Job details. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + DataBoxJobDetails, DataBoxCustomerDiskJobDetails, DataBoxDiskJobDetails, DataBoxHeavyJobDetails + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] + :ivar contact_details: Contact details for notification and shipping. Required. + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :ivar return_package: Return package shipping details. + :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] + :ivar job_details_type: Indicates the type of job details. Required. Known values are: + "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.models.Preferences + :ivar reverse_shipping_details: Optional Reverse Shipping details for order. + :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails + :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 reverse_shipment_label_sas_key: str + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. + :vartype chain_of_custody_sas_key: str + :ivar device_erasure_details: Holds device data erasure details. + :vartype device_erasure_details: ~azure.mgmt.databox.models.DeviceErasureDetails + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: ~azure.mgmt.databox.models.LastMitigationActionOnJob + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: ~azure.mgmt.databox.models.DatacenterAddressResponse + :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", + "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", + "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", + "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", + "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", + "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", + "BJS20", "BL24", "IDC5", "TYO23", "NTG20", "DXB23", "DSM11", "AMS25", "CPQ21", and "OSA23". + :vartype data_center_code: str or ~azure.mgmt.databox.models.DataCenterCode + """ + + __mapping__: dict[str, _Model] = {} + job_stages: Optional[list["_models.JobStages"]] = rest_field(name="jobStages", visibility=["read"]) + """List of stages that run in the job.""" + contact_details: "_models.ContactDetails" = rest_field( + name="contactDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Contact details for notification and shipping. Required.""" + shipping_address: Optional["_models.ShippingAddress"] = rest_field( + name="shippingAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Shipping address of the customer.""" + delivery_package: Optional["_models.PackageShippingDetails"] = rest_field( + name="deliveryPackage", visibility=["read"] + ) + """Delivery package shipping details.""" + return_package: Optional["_models.PackageShippingDetails"] = rest_field(name="returnPackage", visibility=["read"]) + """Return package shipping details.""" + data_import_details: Optional[list["_models.DataImportDetails"]] = rest_field( + name="dataImportDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Details of the data to be imported into azure.""" + data_export_details: Optional[list["_models.DataExportDetails"]] = rest_field( + name="dataExportDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Details of the data to be exported from azure.""" + job_details_type: str = rest_discriminator( + name="jobDetailsType", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates the type of job details. Required. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + preferences: Optional["_models.Preferences"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Preferences for the order.""" + reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = rest_field( + name="reverseShippingDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional Reverse Shipping details for order.""" + copy_log_details: Optional[list["_models.CopyLogDetails"]] = rest_field(name="copyLogDetails", visibility=["read"]) + """List of copy log details.""" + reverse_shipment_label_sas_key: Optional[str] = rest_field(name="reverseShipmentLabelSasKey", visibility=["read"]) + """Shared access key to download the return shipment label.""" + chain_of_custody_sas_key: Optional[str] = rest_field(name="chainOfCustodySasKey", visibility=["read"]) + """Shared access key to download the chain of custody logs.""" + device_erasure_details: Optional["_models.DeviceErasureDetails"] = rest_field( + name="deviceErasureDetails", visibility=["read"] + ) + """Holds device data erasure details.""" + key_encryption_key: Optional["_models.KeyEncryptionKey"] = rest_field( + name="keyEncryptionKey", visibility=["read", "create", "update", "delete", "query"] + ) + """Details about which key encryption type is being used.""" + expected_data_size_in_tera_bytes: Optional[int] = rest_field( + name="expectedDataSizeInTeraBytes", visibility=["read", "create", "update", "delete", "query"] + ) + """The expected size of the data, which needs to be transferred in this job, in terabytes.""" + actions: Optional[list[Union[str, "_models.CustomerResolutionCode"]]] = rest_field(visibility=["read"]) + """Available actions on the job.""" + last_mitigation_action_on_job: Optional["_models.LastMitigationActionOnJob"] = rest_field( + name="lastMitigationActionOnJob", visibility=["read"] + ) + """Last mitigation action performed on the job.""" + datacenter_address: Optional["_models.DatacenterAddressResponse"] = rest_field( + name="datacenterAddress", visibility=["read"] + ) + """Datacenter address to ship to, for the given sku and storage location.""" + data_center_code: Optional[Union[str, "_models.DataCenterCode"]] = rest_field( + name="dataCenterCode", visibility=["read"] + ) + """DataCenter code. Known values are: \"Invalid\", \"BY2\", \"BY1\", \"ORK70\", \"AM2\", + \"AMS20\", \"BY21\", \"BY24\", \"MWH01\", \"AMS06\", \"SSE90\", \"SYD03\", \"SYD23\", + \"CBR20\", \"YTO20\", \"CWL20\", \"LON24\", \"BOM01\", \"BL20\", \"BL7\", \"SEL20\", \"TYO01\", + \"BN1\", \"SN5\", \"CYS04\", \"TYO22\", \"YTO21\", \"YQB20\", \"FRA22\", \"MAA01\", \"CPQ02\", + \"CPQ20\", \"SIN20\", \"HKG20\", \"SG2\", \"MEL23\", \"SEL21\", \"OSA20\", \"SHA03\", \"BJB\", + \"JNB22\", \"JNB21\", \"MNZ21\", \"SN8\", \"AUH20\", \"ZRH20\", \"PUS20\", \"AdHoc\", \"CH1\", + \"DSM05\", \"DUB07\", \"PNQ01\", \"SVG20\", \"OSA02\", \"OSA22\", \"PAR22\", \"BN7\", \"SN6\", + \"BJS20\", \"BL24\", \"IDC5\", \"TYO23\", \"NTG20\", \"DXB23\", \"DSM11\", \"AMS25\", + \"CPQ21\", and \"OSA23\".""" + + @overload + def __init__( + self, + *, + contact_details: "_models.ContactDetails", + job_details_type: str, + shipping_address: Optional["_models.ShippingAddress"] = None, + data_import_details: Optional[list["_models.DataImportDetails"]] = None, + data_export_details: Optional[list["_models.DataExportDetails"]] = None, + preferences: Optional["_models.Preferences"] = None, + reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, + key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataBoxCustomerDiskJobDetails(JobDetails, discriminator="DataBoxCustomerDisk"): + """Customer disk job details. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] + :ivar contact_details: Contact details for notification and shipping. Required. + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :ivar return_package: Return package shipping details. + :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.models.Preferences + :ivar reverse_shipping_details: Optional Reverse Shipping details for order. + :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails + :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 reverse_shipment_label_sas_key: str + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. + :vartype chain_of_custody_sas_key: str + :ivar device_erasure_details: Holds device data erasure details. + :vartype device_erasure_details: ~azure.mgmt.databox.models.DeviceErasureDetails + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: ~azure.mgmt.databox.models.LastMitigationActionOnJob + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: ~azure.mgmt.databox.models.DatacenterAddressResponse + :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", + "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", + "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", + "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", + "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", + "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", + "BJS20", "BL24", "IDC5", "TYO23", "NTG20", "DXB23", "DSM11", "AMS25", "CPQ21", and "OSA23". + :vartype data_center_code: str or ~azure.mgmt.databox.models.DataCenterCode + :ivar import_disk_details_collection: Contains the map of disk serial number to the disk + details for import jobs. + :vartype import_disk_details_collection: dict[str, + ~azure.mgmt.databox.models.ImportDiskDetails] + :ivar export_disk_details_collection: Contains the map of disk serial number to the disk + details for export jobs. + :vartype export_disk_details_collection: dict[str, + ~azure.mgmt.databox.models.ExportDiskDetails] + :ivar copy_progress: Copy progress per disk. + :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxCustomerDiskCopyProgress] + :ivar deliver_to_dc_package_details: Delivery package shipping details. + :vartype deliver_to_dc_package_details: ~azure.mgmt.databox.models.PackageCarrierInfo + :ivar return_to_customer_package_details: Return package shipping details. Required. + :vartype return_to_customer_package_details: ~azure.mgmt.databox.models.PackageCarrierDetails + :ivar enable_manifest_backup: Flag to indicate if disk manifest should be backed-up in the + Storage Account. + :vartype enable_manifest_backup: bool + :ivar job_details_type: Indicates the type of job details. Required. Data Box Customer Disk + orders. + :vartype job_details_type: str or ~azure.mgmt.databox.models.DATA_BOX_CUSTOMER_DISK + """ + + import_disk_details_collection: Optional[dict[str, "_models.ImportDiskDetails"]] = rest_field( + name="importDiskDetailsCollection", visibility=["read", "create", "update", "delete", "query"] + ) + """Contains the map of disk serial number to the disk details for import jobs.""" + export_disk_details_collection: Optional[dict[str, "_models.ExportDiskDetails"]] = rest_field( + name="exportDiskDetailsCollection", visibility=["read"] + ) + """Contains the map of disk serial number to the disk details for export jobs.""" + copy_progress: Optional[list["_models.DataBoxCustomerDiskCopyProgress"]] = rest_field( + name="copyProgress", visibility=["read"] + ) + """Copy progress per disk.""" + deliver_to_dc_package_details: Optional["_models.PackageCarrierInfo"] = rest_field( + name="deliverToDcPackageDetails", visibility=["read"] + ) + """Delivery package shipping details.""" + return_to_customer_package_details: "_models.PackageCarrierDetails" = rest_field( + name="returnToCustomerPackageDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Return package shipping details. Required.""" + enable_manifest_backup: Optional[bool] = rest_field( + name="enableManifestBackup", visibility=["read", "create", "update", "delete", "query"] + ) + """Flag to indicate if disk manifest should be backed-up in the Storage Account.""" + job_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] = rest_discriminator(name="jobDetailsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Indicates the type of job details. Required. Data Box Customer Disk orders.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + contact_details: "_models.ContactDetails", + return_to_customer_package_details: "_models.PackageCarrierDetails", + shipping_address: Optional["_models.ShippingAddress"] = None, + data_import_details: Optional[list["_models.DataImportDetails"]] = None, + data_export_details: Optional[list["_models.DataExportDetails"]] = None, + preferences: Optional["_models.Preferences"] = None, + reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, + key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + import_disk_details_collection: Optional[dict[str, "_models.ImportDiskDetails"]] = None, + enable_manifest_backup: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_details_type = ClassDiscriminator.DATA_BOX_CUSTOMER_DISK # type: ignore + + +class DataBoxDiskCopyLogDetails(CopyLogDetails, discriminator="DataBoxDisk"): + """Copy Log Details for a disk. + + :ivar disk_serial_number: Disk Serial Number. + :vartype disk_serial_number: str + :ivar error_log_link: Link for copy error logs. + :vartype error_log_link: str + :ivar verbose_log_link: Link for copy verbose logs. + :vartype verbose_log_link: str + :ivar copy_log_details_type: Indicates the type of job details. Required. Data Box Disk orders. + :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.DATA_BOX_DISK + """ + + disk_serial_number: Optional[str] = rest_field(name="diskSerialNumber", visibility=["read"]) + """Disk Serial Number.""" + error_log_link: Optional[str] = rest_field(name="errorLogLink", visibility=["read"]) + """Link for copy error logs.""" + verbose_log_link: Optional[str] = rest_field(name="verboseLogLink", visibility=["read"]) + """Link for copy verbose logs.""" + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_DISK] = rest_discriminator(name="copyLogDetailsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Indicates the type of job details. Required. Data Box Disk orders.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.copy_log_details_type = ClassDiscriminator.DATA_BOX_DISK # type: ignore + + +class DataBoxDiskCopyProgress(_Model): + """DataBox Disk Copy Progress. + + :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: int + :ivar percent_complete: Indicates the percentage completed for the copy of the disk. + :vartype percent_complete: int + :ivar status: The Status of the copy. Known values are: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", + "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", + "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". + :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :ivar error: Error, if any, in the stage. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] + """ + + serial_number: Optional[str] = rest_field(name="serialNumber", visibility=["read"]) + """The serial number of the disk.""" + bytes_copied: Optional[int] = rest_field(name="bytesCopied", visibility=["read"]) + """Bytes copied during the copy of disk.""" + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """Indicates the percentage completed for the copy of the disk.""" + status: Optional[Union[str, "_models.CopyStatus"]] = rest_field(visibility=["read"]) + """The Status of the copy. Known values are: \"NotStarted\", \"InProgress\", \"Completed\", + \"CompletedWithErrors\", \"Failed\", \"NotReturned\", \"HardwareError\", \"DeviceFormatted\", + \"DeviceMetadataModified\", \"StorageAccountNotAccessible\", \"UnsupportedData\", + \"DriveNotReceived\", \"UnsupportedDrive\", \"OtherServiceError\", \"OtherUserError\", + \"DriveNotDetected\", \"DriveCorrupted\", and \"MetadataFilesModifiedOrRemoved\".""" + error: Optional["_models.CloudError"] = rest_field(visibility=["read"]) + """Error, if any, in the stage.""" + actions: Optional[list[Union[str, "_models.CustomerResolutionCode"]]] = rest_field(visibility=["read"]) + """Available actions on the job.""" + + +class GranularCopyLogDetails(_Model): + """Granular Details for log generated during copy. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + DataBoxDiskGranularCopyLogDetails + + :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: + "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + """ + + __mapping__: dict[str, _Model] = {} + copy_log_details_type: str = rest_discriminator( + name="copyLogDetailsType", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates the type of job details. Required. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + + @overload + def __init__( + self, + *, + copy_log_details_type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataBoxDiskGranularCopyLogDetails(GranularCopyLogDetails, discriminator="DataBoxCustomerDisk"): + """Granular Copy Log Details for customer disk. + + :ivar serial_number: Disk Serial Number. + :vartype serial_number: str + :ivar account_id: Account id. + :vartype account_id: str + :ivar error_log_link: Link for copy error logs. + :vartype error_log_link: str + :ivar verbose_log_link: Link for copy verbose logs. + :vartype verbose_log_link: str + :ivar copy_log_details_type: Indicates the type of job details. Required. Data Box Customer + Disk orders. + :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.DATA_BOX_CUSTOMER_DISK + """ + + serial_number: Optional[str] = rest_field(name="serialNumber", visibility=["read"]) + """Disk Serial Number.""" + account_id: Optional[str] = rest_field(name="accountId", visibility=["read"]) + """Account id.""" + error_log_link: Optional[str] = rest_field(name="errorLogLink", visibility=["read"]) + """Link for copy error logs.""" + verbose_log_link: Optional[str] = rest_field(name="verboseLogLink", visibility=["read"]) + """Link for copy verbose logs.""" + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] = rest_discriminator(name="copyLogDetailsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Indicates the type of job details. Required. Data Box Customer Disk orders.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.copy_log_details_type = ClassDiscriminator.DATA_BOX_CUSTOMER_DISK # type: ignore + + +class GranularCopyProgress(_Model): + """Granular Copy progress. + + :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType + :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and + "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :ivar account_id: Id of the account where the data needs to be uploaded. + :vartype account_id: str + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: int + :ivar total_bytes_to_process: Total amount of data to be processed by the job. + :vartype total_bytes_to_process: int + :ivar files_processed: Number of files processed. + :vartype files_processed: int + :ivar total_files_to_process: Total files to process. + :vartype total_files_to_process: int + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype invalid_files_processed: int + :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: int + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype renamed_container_count: int + :ivar files_errored_out: Number of files which could not be copied. + :vartype files_errored_out: int + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: int + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: int + :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 + :ivar error: Error, if any, in the stage. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] + """ + + storage_account_name: Optional[str] = rest_field(name="storageAccountName", visibility=["read"]) + """Name of the storage account. This will be empty for data account types other than storage + account.""" + transfer_type: Optional[Union[str, "_models.TransferType"]] = rest_field(name="transferType", visibility=["read"]) + """Transfer type of data. Known values are: \"ImportToAzure\" and \"ExportFromAzure\".""" + data_account_type: Optional[Union[str, "_models.DataAccountType"]] = rest_field( + name="dataAccountType", visibility=["read"] + ) + """Data Account Type. Known values are: \"StorageAccount\" and \"ManagedDisk\".""" + account_id: Optional[str] = rest_field(name="accountId", visibility=["read"]) + """Id of the account where the data needs to be uploaded.""" + bytes_processed: Optional[int] = rest_field(name="bytesProcessed", visibility=["read"]) + """To indicate bytes transferred.""" + total_bytes_to_process: Optional[int] = rest_field(name="totalBytesToProcess", visibility=["read"]) + """Total amount of data to be processed by the job.""" + files_processed: Optional[int] = rest_field(name="filesProcessed", visibility=["read"]) + """Number of files processed.""" + total_files_to_process: Optional[int] = rest_field(name="totalFilesToProcess", visibility=["read"]) + """Total files to process.""" + invalid_files_processed: Optional[int] = rest_field(name="invalidFilesProcessed", visibility=["read"]) + """Number of files not adhering to azure naming conventions which were processed by automatic + renaming.""" + invalid_file_bytes_uploaded: Optional[int] = rest_field(name="invalidFileBytesUploaded", visibility=["read"]) + """Total amount of data not adhering to azure naming conventions which were processed by automatic + renaming.""" + renamed_container_count: Optional[int] = rest_field(name="renamedContainerCount", visibility=["read"]) + """Number of folders not adhering to azure naming conventions which were processed by automatic + renaming.""" + files_errored_out: Optional[int] = rest_field(name="filesErroredOut", visibility=["read"]) + """Number of files which could not be copied.""" + directories_errored_out: Optional[int] = rest_field(name="directoriesErroredOut", visibility=["read"]) + """To indicate directories errored out in the job.""" + invalid_directories_processed: Optional[int] = rest_field(name="invalidDirectoriesProcessed", visibility=["read"]) + """To indicate directories renamed.""" + is_enumeration_in_progress: Optional[bool] = rest_field(name="isEnumerationInProgress", visibility=["read"]) + """To indicate if enumeration of data is in progress. Until this is true, the TotalBytesToProcess + may not be valid.""" + error: Optional["_models.CloudError"] = rest_field(visibility=["read"]) + """Error, if any, in the stage.""" + actions: Optional[list[Union[str, "_models.CustomerResolutionCode"]]] = rest_field(visibility=["read"]) + """Available actions on the job.""" + + +class DataBoxDiskGranularCopyProgress(GranularCopyProgress): + """DataBox Disk Granular Copy Progress. + + :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType + :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and + "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :ivar account_id: Id of the account where the data needs to be uploaded. + :vartype account_id: str + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: int + :ivar total_bytes_to_process: Total amount of data to be processed by the job. + :vartype total_bytes_to_process: int + :ivar files_processed: Number of files processed. + :vartype files_processed: int + :ivar total_files_to_process: Total files to process. + :vartype total_files_to_process: int + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype invalid_files_processed: int + :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: int + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype renamed_container_count: int + :ivar files_errored_out: Number of files which could not be copied. + :vartype files_errored_out: int + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: int + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: int + :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 + :ivar error: Error, if any, in the stage. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] + :ivar serial_number: Disk Serial Number. + :vartype serial_number: str + :ivar copy_status: The Status of the copy. Known values are: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", + "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", + "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". + :vartype copy_status: str or ~azure.mgmt.databox.models.CopyStatus + """ + + serial_number: Optional[str] = rest_field(name="serialNumber", visibility=["read"]) + """Disk Serial Number.""" + copy_status: Optional[Union[str, "_models.CopyStatus"]] = rest_field(name="copyStatus", visibility=["read"]) + """The Status of the copy. Known values are: \"NotStarted\", \"InProgress\", \"Completed\", + \"CompletedWithErrors\", \"Failed\", \"NotReturned\", \"HardwareError\", \"DeviceFormatted\", + \"DeviceMetadataModified\", \"StorageAccountNotAccessible\", \"UnsupportedData\", + \"DriveNotReceived\", \"UnsupportedDrive\", \"OtherServiceError\", \"OtherUserError\", + \"DriveNotDetected\", \"DriveCorrupted\", and \"MetadataFilesModifiedOrRemoved\".""" + + +class DataBoxDiskJobDetails(JobDetails, discriminator="DataBoxDisk"): + """DataBox Disk Job Details. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] + :ivar contact_details: Contact details for notification and shipping. Required. + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :ivar return_package: Return package shipping details. + :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.models.Preferences + :ivar reverse_shipping_details: Optional Reverse Shipping details for order. + :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails + :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 reverse_shipment_label_sas_key: str + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. + :vartype chain_of_custody_sas_key: str + :ivar device_erasure_details: Holds device data erasure details. + :vartype device_erasure_details: ~azure.mgmt.databox.models.DeviceErasureDetails + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: ~azure.mgmt.databox.models.LastMitigationActionOnJob + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: ~azure.mgmt.databox.models.DatacenterAddressResponse + :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", + "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", + "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", + "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", + "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", + "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", + "BJS20", "BL24", "IDC5", "TYO23", "NTG20", "DXB23", "DSM11", "AMS25", "CPQ21", and "OSA23". + :vartype data_center_code: str or ~azure.mgmt.databox.models.DataCenterCode + :ivar 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. + :vartype preferred_disks: dict[str, int] + :ivar copy_progress: Copy progress per disk. + :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] + :ivar granular_copy_progress: Copy progress per disk. + :vartype granular_copy_progress: + list[~azure.mgmt.databox.models.DataBoxDiskGranularCopyProgress] + :ivar granular_copy_log_details: Copy progress per disk. + :vartype granular_copy_log_details: + list[~azure.mgmt.databox.models.DataBoxDiskGranularCopyLogDetails] + :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] + :ivar passkey: User entered passkey for DataBox Disk job. + :vartype passkey: str + :ivar job_details_type: Indicates the type of job details. Required. Data Box Disk orders. + :vartype job_details_type: str or ~azure.mgmt.databox.models.DATA_BOX_DISK + """ + + preferred_disks: Optional[dict[str, int]] = rest_field( + name="preferredDisks", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + copy_progress: Optional[list["_models.DataBoxDiskCopyProgress"]] = rest_field( + name="copyProgress", visibility=["read"] + ) + """Copy progress per disk.""" + granular_copy_progress: Optional[list["_models.DataBoxDiskGranularCopyProgress"]] = rest_field( + name="granularCopyProgress", visibility=["read"] + ) + """Copy progress per disk.""" + granular_copy_log_details: Optional[list["_models.DataBoxDiskGranularCopyLogDetails"]] = rest_field( + name="granularCopyLogDetails", visibility=["read"] + ) + """Copy progress per disk.""" + disks_and_size_details: Optional[dict[str, int]] = rest_field(name="disksAndSizeDetails", visibility=["read"]) + """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.""" + passkey: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """User entered passkey for DataBox Disk job.""" + job_details_type: Literal[ClassDiscriminator.DATA_BOX_DISK] = rest_discriminator(name="jobDetailsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Indicates the type of job details. Required. Data Box Disk orders.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + contact_details: "_models.ContactDetails", + shipping_address: Optional["_models.ShippingAddress"] = None, + data_import_details: Optional[list["_models.DataImportDetails"]] = None, + data_export_details: Optional[list["_models.DataExportDetails"]] = None, + preferences: Optional["_models.Preferences"] = None, + reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, + key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + preferred_disks: Optional[dict[str, int]] = None, + passkey: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_details_type = ClassDiscriminator.DATA_BOX_DISK # type: ignore + + +class DataBoxDiskJobSecrets(JobSecrets, discriminator="DataBoxDisk"): + """The secrets related to disk job. + + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar disk_secrets: Contains the list of secrets object for that device. + :vartype disk_secrets: list[~azure.mgmt.databox.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. + :vartype is_passkey_user_defined: bool + :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Data Box + Disk orders. + :vartype job_secrets_type: str or ~azure.mgmt.databox.models.DATA_BOX_DISK + """ + + disk_secrets: Optional[list["_models.DiskSecret"]] = rest_field(name="diskSecrets", visibility=["read"]) + """Contains the list of secrets object for that device.""" + pass_key: Optional[str] = rest_field(name="passKey", visibility=["read"]) + """PassKey for the disk Job.""" + is_passkey_user_defined: Optional[bool] = rest_field(name="isPasskeyUserDefined", visibility=["read"]) + """Whether passkey was provided by user.""" + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_DISK] = rest_discriminator(name="jobSecretsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Used to indicate what type of job secrets object. Required. Data Box Disk orders.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_secrets_type = ClassDiscriminator.DATA_BOX_DISK # type: ignore + + +class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails, discriminator="DataBoxHeavy"): + """Copy log details for a storage account for Databox heavy. + + :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] + :ivar copy_log_details_type: Indicates the type of job details. Required. Data Box Heavy + orders. + :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.DATA_BOX_HEAVY + """ + + account_name: Optional[str] = rest_field(name="accountName", visibility=["read"]) + """Account name.""" + copy_log_link: Optional[list[str]] = rest_field(name="copyLogLink", visibility=["read"]) + """Link for copy logs.""" + copy_verbose_log_link: Optional[list[str]] = rest_field(name="copyVerboseLogLink", visibility=["read"]) + """Link for copy verbose logs. This will be set only when the LogCollectionLevel is set to + verbose.""" + copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] = rest_discriminator(name="copyLogDetailsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Indicates the type of job details. Required. Data Box Heavy orders.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.copy_log_details_type = ClassDiscriminator.DATA_BOX_HEAVY # type: ignore + + +class DataBoxHeavyJobDetails(JobDetails, discriminator="DataBoxHeavy"): + """Databox Heavy Device Job Details. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] + :ivar contact_details: Contact details for notification and shipping. Required. + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :ivar return_package: Return package shipping details. + :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.models.Preferences + :ivar reverse_shipping_details: Optional Reverse Shipping details for order. + :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails + :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 reverse_shipment_label_sas_key: str + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. + :vartype chain_of_custody_sas_key: str + :ivar device_erasure_details: Holds device data erasure details. + :vartype device_erasure_details: ~azure.mgmt.databox.models.DeviceErasureDetails + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: ~azure.mgmt.databox.models.LastMitigationActionOnJob + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: ~azure.mgmt.databox.models.DatacenterAddressResponse + :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", + "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", + "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", + "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", + "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", + "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", + "BJS20", "BL24", "IDC5", "TYO23", "NTG20", "DXB23", "DSM11", "AMS25", "CPQ21", and "OSA23". + :vartype data_center_code: str or ~azure.mgmt.databox.models.DataCenterCode + :ivar copy_progress: Copy progress per account. + :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] + :ivar 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 : @#\\-$%^!+=;:_()]+. + :vartype device_password: str + :ivar job_details_type: Indicates the type of job details. Required. Data Box Heavy orders. + :vartype job_details_type: str or ~azure.mgmt.databox.models.DATA_BOX_HEAVY + """ + + copy_progress: Optional[list["_models.CopyProgress"]] = rest_field(name="copyProgress", visibility=["read"]) + """Copy progress per account.""" + device_password: Optional[str] = rest_field( + name="devicePassword", visibility=["read", "create", "update", "delete", "query"] + ) + """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 : @#\\-$%^!+=;:_()]+.""" + job_details_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] = rest_discriminator(name="jobDetailsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Indicates the type of job details. Required. Data Box Heavy orders.""" + + @overload + def __init__( + self, + *, + contact_details: "_models.ContactDetails", + shipping_address: Optional["_models.ShippingAddress"] = None, + data_import_details: Optional[list["_models.DataImportDetails"]] = None, + data_export_details: Optional[list["_models.DataExportDetails"]] = None, + preferences: Optional["_models.Preferences"] = None, + reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, + key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + device_password: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_details_type = ClassDiscriminator.DATA_BOX_HEAVY # type: ignore + + +class DataBoxHeavyJobSecrets(JobSecrets, discriminator="DataBoxHeavy"): + """The secrets related to a databox heavy job. + + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~azure.mgmt.databox.models.CloudError + :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] + :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Data Box + Heavy orders. + :vartype job_secrets_type: str or ~azure.mgmt.databox.models.DATA_BOX_HEAVY + """ + + cabinet_pod_secrets: Optional[list["_models.DataBoxHeavySecret"]] = rest_field( + name="cabinetPodSecrets", visibility=["read"] + ) + """Contains the list of secret objects for a databox heavy job.""" + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] = rest_discriminator(name="jobSecretsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Used to indicate what type of job secrets object. Required. Data Box Heavy orders.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_secrets_type = ClassDiscriminator.DATA_BOX_HEAVY # type: ignore + + +class DataBoxHeavySecret(_Model): + """The secrets related to a databox heavy. + + :ivar device_serial_number: Serial number of the assigned device. + :vartype device_serial_number: str + :ivar device_password: Password for out of the box experience on device. + :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. + :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] + """ + + device_serial_number: Optional[str] = rest_field(name="deviceSerialNumber", visibility=["read"]) + """Serial number of the assigned device.""" + device_password: Optional[str] = rest_field(name="devicePassword", visibility=["read"]) + """Password for out of the box experience on device.""" + network_configurations: Optional[list["_models.ApplianceNetworkConfiguration"]] = rest_field( + name="networkConfigurations", visibility=["read"] + ) + """Network configuration of the appliance.""" + encoded_validation_cert_pub_key: Optional[str] = rest_field(name="encodedValidationCertPubKey", visibility=["read"]) + """The base 64 encoded public key to authenticate with the device.""" + account_credential_details: Optional[list["_models.AccountCredentialDetails"]] = rest_field( + name="accountCredentialDetails", visibility=["read"] + ) + """Per account level access credentials.""" + + +class DataBoxJobDetails(JobDetails, discriminator="DataBox"): + """Databox Job Details. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] + :ivar contact_details: Contact details for notification and shipping. Required. + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :ivar return_package: Return package shipping details. + :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.models.Preferences + :ivar reverse_shipping_details: Optional Reverse Shipping details for order. + :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails + :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 reverse_shipment_label_sas_key: str + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. + :vartype chain_of_custody_sas_key: str + :ivar device_erasure_details: Holds device data erasure details. + :vartype device_erasure_details: ~azure.mgmt.databox.models.DeviceErasureDetails + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: ~azure.mgmt.databox.models.LastMitigationActionOnJob + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: ~azure.mgmt.databox.models.DatacenterAddressResponse + :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", + "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", + "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", + "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", + "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", + "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", + "BJS20", "BL24", "IDC5", "TYO23", "NTG20", "DXB23", "DSM11", "AMS25", "CPQ21", and "OSA23". + :vartype data_center_code: str or ~azure.mgmt.databox.models.DataCenterCode + :ivar copy_progress: Copy progress per storage account. + :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] + :ivar 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 : @#\\-$%^!+=;:_()]+. + :vartype device_password: str + :ivar job_details_type: Indicates the type of job details. Required. Data Box orders. + :vartype job_details_type: str or ~azure.mgmt.databox.models.DATA_BOX + """ + + copy_progress: Optional[list["_models.CopyProgress"]] = rest_field(name="copyProgress", visibility=["read"]) + """Copy progress per storage account.""" + device_password: Optional[str] = rest_field( + name="devicePassword", visibility=["read", "create", "update", "delete", "query"] + ) + """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 : @#\\-$%^!+=;:_()]+.""" + job_details_type: Literal[ClassDiscriminator.DATA_BOX] = rest_discriminator(name="jobDetailsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Indicates the type of job details. Required. Data Box orders.""" + + @overload + def __init__( + self, + *, + contact_details: "_models.ContactDetails", + shipping_address: Optional["_models.ShippingAddress"] = None, + data_import_details: Optional[list["_models.DataImportDetails"]] = None, + data_export_details: Optional[list["_models.DataExportDetails"]] = None, + preferences: Optional["_models.Preferences"] = None, + reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, + key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + device_password: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_details_type = ClassDiscriminator.DATA_BOX # type: ignore + + +class DataboxJobSecrets(JobSecrets, discriminator="DataBox"): + """The secrets related to a databox job. + + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar pod_secrets: Contains the list of secret objects for a job. + :vartype pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Data Box + orders. + :vartype job_secrets_type: str or ~azure.mgmt.databox.models.DATA_BOX + """ + + pod_secrets: Optional[list["_models.DataBoxSecret"]] = rest_field( + name="podSecrets", visibility=["read", "create", "update", "delete", "query"] + ) + """Contains the list of secret objects for a job.""" + job_secrets_type: Literal[ClassDiscriminator.DATA_BOX] = rest_discriminator(name="jobSecretsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Used to indicate what type of job secrets object. Required. Data Box orders.""" + + @overload + def __init__( + self, + *, + pod_secrets: Optional[list["_models.DataBoxSecret"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_secrets_type = ClassDiscriminator.DATA_BOX # type: ignore + + +class ScheduleAvailabilityRequest(_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 + + :ivar storage_location: Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype storage_location: str + :ivar sku_name: Sku Name for which the order is to be scheduled. Required. Known values are: + "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + """ + + __mapping__: dict[str, _Model] = {} + storage_location: str = rest_field( + name="storageLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required.""" + sku_name: str = rest_discriminator(name="skuName", visibility=["read", "create", "update", "delete", "query"]) + """Sku Name for which the order is to be scheduled. Required. Known values are: \"DataBox\", + \"DataBoxDisk\", \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Country in which storage location should be supported.""" + model: Optional[Union[str, "_models.ModelName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + + @overload + def __init__( + self, + *, + storage_location: str, + sku_name: str, + country: Optional[str] = None, + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest, discriminator="DataBox"): + """Request body to get the availability for scheduling data box orders orders. + + :ivar storage_location: Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype storage_location: str + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + :ivar sku_name: Sku Name for which the order is to be scheduled. Required. Data Box. + :vartype sku_name: str or ~azure.mgmt.databox.models.DATA_BOX + """ + + sku_name: Literal[SkuName.DATA_BOX] = rest_discriminator(name="skuName", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Sku Name for which the order is to be scheduled. Required. Data Box.""" + + @overload + def __init__( + self, + *, + storage_location: str, + country: Optional[str] = None, + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.sku_name = SkuName.DATA_BOX # type: ignore + + +class DataBoxSecret(_Model): + """The secrets related to a DataBox. + + :ivar device_serial_number: Serial number of the assigned device. + :vartype device_serial_number: str + :ivar device_password: Password for out of the box experience on device. + :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. + :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] + """ + + device_serial_number: Optional[str] = rest_field(name="deviceSerialNumber", visibility=["read"]) + """Serial number of the assigned device.""" + device_password: Optional[str] = rest_field(name="devicePassword", visibility=["read"]) + """Password for out of the box experience on device.""" + network_configurations: Optional[list["_models.ApplianceNetworkConfiguration"]] = rest_field( + name="networkConfigurations", visibility=["read"] + ) + """Network configuration of the appliance.""" + encoded_validation_cert_pub_key: Optional[str] = rest_field(name="encodedValidationCertPubKey", visibility=["read"]) + """The base 64 encoded public key to authenticate with the device.""" + account_credential_details: Optional[list["_models.AccountCredentialDetails"]] = rest_field( + name="accountCredentialDetails", visibility=["read"] + ) + """Per account level access credentials.""" + + +class DatacenterAddressResponse(_Model): + """Datacenter address for given storage location. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + DatacenterAddressInstructionResponse, DatacenterAddressLocationResponse + + :ivar datacenter_address_type: Data center address type. Required. Known values are: + "DatacenterAddressLocation" and "DatacenterAddressInstruction". + :vartype datacenter_address_type: str or ~azure.mgmt.databox.models.DatacenterAddressType + :ivar supported_carriers_for_return_shipment: List of supported carriers for return shipment. + :vartype supported_carriers_for_return_shipment: list[str] + :ivar data_center_azure_location: Azure Location where the Data Center serves primarily. + :vartype data_center_azure_location: str + """ + + __mapping__: dict[str, _Model] = {} + datacenter_address_type: str = rest_discriminator( + name="datacenterAddressType", visibility=["read", "create", "update", "delete", "query"] + ) + """Data center address type. Required. Known values are: \"DatacenterAddressLocation\" and + \"DatacenterAddressInstruction\".""" + supported_carriers_for_return_shipment: Optional[list[str]] = rest_field( + name="supportedCarriersForReturnShipment", visibility=["read"] + ) + """List of supported carriers for return shipment.""" + data_center_azure_location: Optional[str] = rest_field(name="dataCenterAzureLocation", visibility=["read"]) + """Azure Location where the Data Center serves primarily.""" + + @overload + def __init__( + self, + *, + datacenter_address_type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatacenterAddressInstructionResponse(DatacenterAddressResponse, discriminator="DatacenterAddressInstruction"): + """Datacenter instruction for given storage location. + + :ivar supported_carriers_for_return_shipment: List of supported carriers for return shipment. + :vartype supported_carriers_for_return_shipment: list[str] + :ivar data_center_azure_location: Azure Location where the Data Center serves primarily. + :vartype data_center_azure_location: str + :ivar communication_instruction: Data center communication instruction. + :vartype communication_instruction: str + :ivar datacenter_address_type: Data center address type. Required. Data center address + instruction. + :vartype datacenter_address_type: str or + ~azure.mgmt.databox.models.DATACENTER_ADDRESS_INSTRUCTION + """ + + communication_instruction: Optional[str] = rest_field(name="communicationInstruction", visibility=["read"]) + """Data center communication instruction.""" + datacenter_address_type: Literal[DatacenterAddressType.DATACENTER_ADDRESS_INSTRUCTION] = rest_discriminator(name="datacenterAddressType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Data center address type. Required. Data center address instruction.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.datacenter_address_type = DatacenterAddressType.DATACENTER_ADDRESS_INSTRUCTION # type: ignore + + +class DatacenterAddressLocationResponse(DatacenterAddressResponse, discriminator="DatacenterAddressLocation"): + """Datacenter address for given storage location. + + :ivar supported_carriers_for_return_shipment: List of supported carriers for return shipment. + :vartype supported_carriers_for_return_shipment: list[str] + :ivar data_center_azure_location: Azure Location where the Data Center serves primarily. + :vartype data_center_azure_location: str + :ivar contact_person_name: Contact person name. + :vartype contact_person_name: str + :ivar company: Company name. + :vartype company: str + :ivar street1: Street address line 1. + :vartype street1: str + :ivar street2: Street address line 2. + :vartype street2: str + :ivar street3: Street address line 3. + :vartype street3: str + :ivar city: City name. + :vartype city: str + :ivar state: name of the state. + :vartype state: str + :ivar zip: Zip code. + :vartype zip: str + :ivar country: name of the country. + :vartype country: str + :ivar phone: Phone number. + :vartype phone: str + :ivar phone_extension: Phone extension. + :vartype phone_extension: str + :ivar address_type: Address type. + :vartype address_type: str + :ivar additional_shipping_information: Special instruction for shipping. + :vartype additional_shipping_information: str + :ivar datacenter_address_type: Data center address type. Required. Data center address + location. + :vartype datacenter_address_type: str or ~azure.mgmt.databox.models.DATACENTER_ADDRESS_LOCATION + """ + + contact_person_name: Optional[str] = rest_field(name="contactPersonName", visibility=["read"]) + """Contact person name.""" + company: Optional[str] = rest_field(visibility=["read"]) + """Company name.""" + street1: Optional[str] = rest_field(visibility=["read"]) + """Street address line 1.""" + street2: Optional[str] = rest_field(visibility=["read"]) + """Street address line 2.""" + street3: Optional[str] = rest_field(visibility=["read"]) + """Street address line 3.""" + city: Optional[str] = rest_field(visibility=["read"]) + """City name.""" + state: Optional[str] = rest_field(visibility=["read"]) + """name of the state.""" + zip: Optional[str] = rest_field(visibility=["read"]) + """Zip code.""" + country: Optional[str] = rest_field(visibility=["read"]) + """name of the country.""" + phone: Optional[str] = rest_field(visibility=["read"]) + """Phone number.""" + phone_extension: Optional[str] = rest_field(name="phoneExtension", visibility=["read"]) + """Phone extension.""" + address_type: Optional[str] = rest_field(name="addressType", visibility=["read"]) + """Address type.""" + additional_shipping_information: Optional[str] = rest_field( + name="additionalShippingInformation", visibility=["read"] + ) + """Special instruction for shipping.""" + datacenter_address_type: Literal[DatacenterAddressType.DATACENTER_ADDRESS_LOCATION] = rest_discriminator(name="datacenterAddressType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Data center address type. Required. Data center address location.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.datacenter_address_type = DatacenterAddressType.DATACENTER_ADDRESS_LOCATION # type: ignore + + +class DatacenterAddressRequest(_Model): + """Request body to get the datacenter address. + + :ivar storage_location: Storage location. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype storage_location: str + :ivar sku_name: Sku Name for which the data center address requested. Required. Known values + are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + """ + + storage_location: str = rest_field( + name="storageLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage location. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required.""" + sku_name: Union[str, "_models.SkuName"] = rest_field( + name="skuName", visibility=["read", "create", "update", "delete", "query"] + ) + """Sku Name for which the data center address requested. Required. Known values are: \"DataBox\", + \"DataBoxDisk\", \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + model: Optional[Union[str, "_models.ModelName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + + @overload + def __init__( + self, + *, + storage_location: str, + sku_name: Union[str, "_models.SkuName"], + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataExportDetails(_Model): + """Details of the data to be used for exporting data from azure. + + :ivar transfer_configuration: Configuration for the data transfer. Required. + :vartype transfer_configuration: ~azure.mgmt.databox.models.TransferConfiguration + :ivar log_collection_level: Level of the logs to be collected. Known values are: "Error" and + "Verbose". + :vartype log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel + :ivar account_details: Account details of the data to be transferred. Required. + :vartype account_details: ~azure.mgmt.databox.models.DataAccountDetails + """ + + transfer_configuration: "_models.TransferConfiguration" = rest_field( + name="transferConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the data transfer. Required.""" + log_collection_level: Optional[Union[str, "_models.LogCollectionLevel"]] = rest_field( + name="logCollectionLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """Level of the logs to be collected. Known values are: \"Error\" and \"Verbose\".""" + account_details: "_models.DataAccountDetails" = rest_field( + name="accountDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Account details of the data to be transferred. Required.""" + + @overload + def __init__( + self, + *, + transfer_configuration: "_models.TransferConfiguration", + account_details: "_models.DataAccountDetails", + log_collection_level: Optional[Union[str, "_models.LogCollectionLevel"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataImportDetails(_Model): + """Details of the data to be used for importing data to azure. + + :ivar account_details: Account details of the data to be transferred. Required. + :vartype account_details: ~azure.mgmt.databox.models.DataAccountDetails + :ivar log_collection_level: Level of the logs to be collected. Known values are: "Error" and + "Verbose". + :vartype log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel + """ + + account_details: "_models.DataAccountDetails" = rest_field( + name="accountDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Account details of the data to be transferred. Required.""" + log_collection_level: Optional[Union[str, "_models.LogCollectionLevel"]] = rest_field( + name="logCollectionLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """Level of the logs to be collected. Known values are: \"Error\" and \"Verbose\".""" + + @overload + def __init__( + self, + *, + account_details: "_models.DataAccountDetails", + log_collection_level: Optional[Union[str, "_models.LogCollectionLevel"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataLocationToServiceLocationMap(_Model): + """Map of data location to service location. + + :ivar data_location: Location of the data. + :vartype data_location: str + :ivar service_location: Location of the service. + :vartype service_location: str + """ + + data_location: Optional[str] = rest_field(name="dataLocation", visibility=["read"]) + """Location of the data.""" + service_location: Optional[str] = rest_field(name="serviceLocation", visibility=["read"]) + """Location of the service.""" + + +class DataTransferDetailsValidationRequest(ValidationInputRequest, discriminator="ValidateDataTransferDetails"): + """Request to validate export and import data details. + + :ivar data_export_details: List of DataTransfer details to be used to export data from azure. + :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] + :ivar data_import_details: List of DataTransfer details to be used to import data to azure. + :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] + :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype device_type: str or ~azure.mgmt.databox.models.SkuName + :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response of data transfer details validation. + :vartype validation_type: str or ~azure.mgmt.databox.models.VALIDATE_DATA_TRANSFER_DETAILS + """ + + data_export_details: Optional[list["_models.DataExportDetails"]] = rest_field( + name="dataExportDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """List of DataTransfer details to be used to export data from azure.""" + data_import_details: Optional[list["_models.DataImportDetails"]] = rest_field( + name="dataImportDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """List of DataTransfer details to be used to import data to azure.""" + device_type: Union[str, "_models.SkuName"] = rest_field( + name="deviceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Device type. Required. Known values are: \"DataBox\", \"DataBoxDisk\", \"DataBoxHeavy\", and + \"DataBoxCustomerDisk\".""" + transfer_type: Union[str, "_models.TransferType"] = rest_field( + name="transferType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the transfer. Required. Known values are: \"ImportToAzure\" and \"ExportFromAzure\".""" + model: Optional[Union[str, "_models.ModelName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation request. Required. Identify request and response of data + transfer details validation.""" + + @overload + def __init__( + self, + *, + device_type: Union[str, "_models.SkuName"], + transfer_type: Union[str, "_models.TransferType"], + data_export_details: Optional[list["_models.DataExportDetails"]] = None, + data_import_details: Optional[list["_models.DataImportDetails"]] = None, + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS # type: ignore + + +class DataTransferDetailsValidationResponseProperties( + ValidationInputResponse, discriminator="ValidateDataTransferDetails" +): # pylint: disable=name-too-long + """Properties of data transfer details validation response. + + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", + and "Skipped". + :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response of data transfer details validation. + :vartype validation_type: str or ~azure.mgmt.databox.models.VALIDATE_DATA_TRANSFER_DETAILS + """ + + status: Optional[Union[str, "_models.ValidationStatus"]] = rest_field(visibility=["read"]) + """Data transfer details validation status. Known values are: \"Valid\", \"Invalid\", and + \"Skipped\".""" + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation response. Required. Identify request and response of data + transfer details validation.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS # type: ignore + + +class DcAccessSecurityCode(_Model): + """Dc access security code. + + :ivar reverse_dc_access_code: Reverse Dc access security code. + :vartype reverse_dc_access_code: str + :ivar forward_dc_access_code: Forward Dc access security code. + :vartype forward_dc_access_code: str + """ + + reverse_dc_access_code: Optional[str] = rest_field( + name="reverseDCAccessCode", visibility=["read", "create", "update", "delete", "query"] + ) + """Reverse Dc access security code.""" + forward_dc_access_code: Optional[str] = rest_field( + name="forwardDCAccessCode", visibility=["read", "create", "update", "delete", "query"] + ) + """Forward Dc access security code.""" + + @overload + def __init__( + self, + *, + reverse_dc_access_code: Optional[str] = None, + forward_dc_access_code: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Details(_Model): + """Details. + + :ivar code: Error code. Required. + :vartype code: str + :ivar message: Error message. Required. + :vartype message: str + """ + + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error code. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error message. Required.""" + + @overload + def __init__( + self, + *, + code: str, + message: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DeviceCapabilityDetails(_Model): + """Device capability details for a given sku for a given region. + + :ivar hardware_encryption: Hardware encryption support for a given sku for a given region. + Known values are: "Enabled" and "Disabled". + :vartype hardware_encryption: str or ~azure.mgmt.databox.models.HardwareEncryption + """ + + hardware_encryption: Optional[Union[str, "_models.HardwareEncryption"]] = rest_field( + name="hardwareEncryption", visibility=["read"] + ) + """Hardware encryption support for a given sku for a given region. Known values are: \"Enabled\" + and \"Disabled\".""" + + +class DeviceCapabilityRequest(_Model): + """Request body to get the device capabilities for given sku. + + :ivar sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", + and "DataBoxCustomerDisk". + :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + """ + + sku_name: Optional[Union[str, "_models.SkuName"]] = rest_field( + name="skuName", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the device. Known values are: \"DataBox\", \"DataBoxDisk\", \"DataBoxHeavy\", and + \"DataBoxCustomerDisk\".""" + model: Optional[Union[str, "_models.ModelName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + + @overload + def __init__( + self, + *, + sku_name: Optional[Union[str, "_models.SkuName"]] = None, + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DeviceCapabilityResponse(_Model): + """Device capabilities for given sku in a region. + + :ivar device_capability_details: List of device capabilities available for a given region and a + given sku. + :vartype device_capability_details: list[~azure.mgmt.databox.models.DeviceCapabilityDetails] + """ + + device_capability_details: Optional[list["_models.DeviceCapabilityDetails"]] = rest_field( + name="deviceCapabilityDetails", visibility=["read"] + ) + """List of device capabilities available for a given region and a given sku.""" + + +class DeviceErasureDetails(_Model): + """Device erasure details with erasure completion status, secure erasure sas key and + erasureordestructionlog sas key. + + :ivar device_erasure_status: Holds the device erasure completion status. Known values are: + "None", "InProgress", "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", + "WaitingForCustomerAction", "SucceededWithWarnings", "WaitingForCustomerActionForKek", + "WaitingForCustomerActionForCleanUp", "CustomerActionPerformedForCleanUp", and + "CustomerActionPerformed". + :vartype device_erasure_status: str or ~azure.mgmt.databox.models.StageStatus + :ivar erasure_or_destruction_certificate_sas_key: Shared access key to download cleanup or + destruction certificate for device. + :vartype erasure_or_destruction_certificate_sas_key: str + :ivar secure_erasure_certificate_sas_key: Shared access key to download secure erasure + certificate for the device. + :vartype secure_erasure_certificate_sas_key: str + """ + + device_erasure_status: Optional[Union[str, "_models.StageStatus"]] = rest_field( + name="deviceErasureStatus", visibility=["read"] + ) + """Holds the device erasure completion status. Known values are: \"None\", \"InProgress\", + \"Succeeded\", \"Failed\", \"Cancelled\", \"Cancelling\", \"SucceededWithErrors\", + \"WaitingForCustomerAction\", \"SucceededWithWarnings\", \"WaitingForCustomerActionForKek\", + \"WaitingForCustomerActionForCleanUp\", \"CustomerActionPerformedForCleanUp\", and + \"CustomerActionPerformed\".""" + erasure_or_destruction_certificate_sas_key: Optional[str] = rest_field( + name="erasureOrDestructionCertificateSasKey", visibility=["read"] + ) + """Shared access key to download cleanup or destruction certificate for device.""" + secure_erasure_certificate_sas_key: Optional[str] = rest_field( + name="secureErasureCertificateSasKey", visibility=["read"] + ) + """Shared access key to download secure erasure certificate for the device.""" + + +class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest, discriminator="DataBoxDisk"): + """Request body to get the availability for scheduling disk orders. + + :ivar storage_location: Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype storage_location: str + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. Required. + :vartype expected_data_size_in_tera_bytes: int + :ivar sku_name: Sku Name for which the order is to be scheduled. Required. Data Box Disk. + :vartype sku_name: str or ~azure.mgmt.databox.models.DATA_BOX_DISK + """ + + expected_data_size_in_tera_bytes: int = rest_field( + name="expectedDataSizeInTeraBytes", visibility=["read", "create", "update", "delete", "query"] + ) + """The expected size of the data, which needs to be transferred in this job, in terabytes. + Required.""" + sku_name: Literal[SkuName.DATA_BOX_DISK] = rest_discriminator(name="skuName", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Sku Name for which the order is to be scheduled. Required. Data Box Disk.""" + + @overload + def __init__( + self, + *, + storage_location: str, + expected_data_size_in_tera_bytes: int, + country: Optional[str] = None, + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.sku_name = SkuName.DATA_BOX_DISK # type: ignore + + +class DiskSecret(_Model): + """Contains all the secrets of a Disk. + + :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. + :vartype bit_locker_key: str + """ + + disk_serial_number: Optional[str] = rest_field(name="diskSerialNumber", visibility=["read"]) + """Serial number of the assigned disk.""" + bit_locker_key: Optional[str] = rest_field(name="bitLockerKey", visibility=["read"]) + """Bit Locker key of the disk which can be used to unlock the disk to copy data.""" + + +class EncryptionPreferences(_Model): + """Preferences related to the Encryption. + + :ivar double_encryption: Defines secondary layer of software-based encryption enablement. Known + values are: "Enabled" and "Disabled". + :vartype double_encryption: str or ~azure.mgmt.databox.models.DoubleEncryption + :ivar hardware_encryption: Defines Hardware level encryption (Only for disk). Known values are: + "Enabled" and "Disabled". + :vartype hardware_encryption: str or ~azure.mgmt.databox.models.HardwareEncryption + """ + + double_encryption: Optional[Union[str, "_models.DoubleEncryption"]] = rest_field( + name="doubleEncryption", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines secondary layer of software-based encryption enablement. Known values are: \"Enabled\" + and \"Disabled\".""" + hardware_encryption: Optional[Union[str, "_models.HardwareEncryption"]] = rest_field( + name="hardwareEncryption", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines Hardware level encryption (Only for disk). Known values are: \"Enabled\" and + \"Disabled\".""" + + @overload + def __init__( + self, + *, + double_encryption: Optional[Union[str, "_models.DoubleEncryption"]] = None, + hardware_encryption: Optional[Union[str, "_models.HardwareEncryption"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ErrorDetail(_Model): + """ErrorDetail. + + :ivar code: Error code. Required. + :vartype code: str + :ivar message: Error message. Required. + :vartype message: str + :ivar details: Error target. + :vartype details: list[~azure.mgmt.databox.models.Details] + :ivar target: Additional error info. + :vartype target: str + """ + + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error code. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error message. Required.""" + details: Optional[list["_models.Details"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error target.""" + target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional error info.""" + + @overload + def __init__( + self, + *, + code: str, + message: str, + details: Optional[list["_models.Details"]] = None, + target: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExportDiskDetails(_Model): + """Export disk details. + + :ivar manifest_file: The relative path of the manifest file on the disk. + :vartype manifest_file: str + :ivar manifest_hash: The Base16-encoded MD5 hash of the manifest file on the disk. + :vartype manifest_hash: str + :ivar backup_manifest_cloud_path: Path to backed up manifest, only returned if + enableManifestBackup is true. + :vartype backup_manifest_cloud_path: str + """ + + manifest_file: Optional[str] = rest_field(name="manifestFile", visibility=["read"]) + """The relative path of the manifest file on the disk.""" + manifest_hash: Optional[str] = rest_field(name="manifestHash", visibility=["read"]) + """The Base16-encoded MD5 hash of the manifest file on the disk.""" + backup_manifest_cloud_path: Optional[str] = rest_field(name="backupManifestCloudPath", visibility=["read"]) + """Path to backed up manifest, only returned if enableManifestBackup is true.""" + + +class FilterFileDetails(_Model): + """Details of the filter files to be used for data transfer. + + :ivar filter_file_type: Type of the filter file. Required. Known values are: "AzureBlob" and + "AzureFile". + :vartype filter_file_type: str or ~azure.mgmt.databox.models.FilterFileType + :ivar filter_file_path: Path of the file that contains the details of all items to transfer. + Required. + :vartype filter_file_path: str + """ + + filter_file_type: Union[str, "_models.FilterFileType"] = rest_field( + name="filterFileType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the filter file. Required. Known values are: \"AzureBlob\" and \"AzureFile\".""" + filter_file_path: str = rest_field( + name="filterFilePath", visibility=["read", "create", "update", "delete", "query"] + ) + """Path of the file that contains the details of all items to transfer. Required.""" + + @overload + def __init__( + self, + *, + filter_file_type: Union[str, "_models.FilterFileType"], + filter_file_path: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest, discriminator="DataBoxHeavy"): + """Request body to get the availability for scheduling heavy orders. + + :ivar storage_location: Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype storage_location: str + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + :ivar sku_name: Sku Name for which the order is to be scheduled. Required. Data Box Heavy. + :vartype sku_name: str or ~azure.mgmt.databox.models.DATA_BOX_HEAVY + """ + + sku_name: Literal[SkuName.DATA_BOX_HEAVY] = rest_discriminator(name="skuName", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Sku Name for which the order is to be scheduled. Required. Data Box Heavy.""" + + @overload + def __init__( + self, + *, + storage_location: str, + country: Optional[str] = None, + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.sku_name = SkuName.DATA_BOX_HEAVY # type: ignore + + +class IdentityProperties(_Model): + """Managed identity properties. + + :ivar type: Managed service identity type. + :vartype type: str + :ivar user_assigned: User assigned identity properties. + :vartype user_assigned: ~azure.mgmt.databox.models.UserAssignedProperties + """ + + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Managed service identity type.""" + user_assigned: Optional["_models.UserAssignedProperties"] = rest_field( + name="userAssigned", visibility=["read", "create", "update", "delete", "query"] + ) + """User assigned identity properties.""" + + @overload + def __init__( + self, + *, + type: Optional[str] = None, + user_assigned: Optional["_models.UserAssignedProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ImportDiskDetails(_Model): + """Import disk details. + + :ivar manifest_file: The relative path of the manifest file on the disk. Required. + :vartype manifest_file: str + :ivar manifest_hash: The Base16-encoded MD5 hash of the manifest file on the disk. Required. + :vartype manifest_hash: str + :ivar bit_locker_key: BitLocker key used to encrypt the disk. Required. + :vartype bit_locker_key: str + :ivar backup_manifest_cloud_path: Path to backed up manifest, only returned if + enableManifestBackup is true. + :vartype backup_manifest_cloud_path: str + """ + + manifest_file: str = rest_field(name="manifestFile", visibility=["read", "create", "update", "delete", "query"]) + """The relative path of the manifest file on the disk. Required.""" + manifest_hash: str = rest_field(name="manifestHash", visibility=["read", "create", "update", "delete", "query"]) + """The Base16-encoded MD5 hash of the manifest file on the disk. Required.""" + bit_locker_key: str = rest_field(name="bitLockerKey", visibility=["read", "create", "update", "delete", "query"]) + """BitLocker key used to encrypt the disk. Required.""" + backup_manifest_cloud_path: Optional[str] = rest_field(name="backupManifestCloudPath", visibility=["read"]) + """Path to backed up manifest, only returned if enableManifestBackup is true.""" + + @overload + def __init__( + self, + *, + manifest_file: str, + manifest_hash: str, + bit_locker_key: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobDelayDetails(_Model): + """Job Delay Notification details. + + :ivar status: Status of notification. Known values are: "Active" and "Resolved". + :vartype status: str or ~azure.mgmt.databox.models.DelayNotificationStatus + :ivar error_code: Delay Error code. Known values are: "InternalIssueDelay", + "ActiveOrderLimitBreachedDelay", "HighDemandDelay", and "LargeNumberOfFilesDelay". + :vartype error_code: str or ~azure.mgmt.databox.models.PortalDelayErrorCode + :ivar description: Description of the delay. + :vartype description: str + :ivar start_time: Timestamp when the delay notification was created. + :vartype start_time: ~datetime.datetime + :ivar resolution_time: Timestamp when the delay notification was resolved. + :vartype resolution_time: ~datetime.datetime + """ + + status: Optional[Union[str, "_models.DelayNotificationStatus"]] = rest_field(visibility=["read"]) + """Status of notification. Known values are: \"Active\" and \"Resolved\".""" + error_code: Optional[Union[str, "_models.PortalDelayErrorCode"]] = rest_field(name="errorCode", visibility=["read"]) + """Delay Error code. Known values are: \"InternalIssueDelay\", \"ActiveOrderLimitBreachedDelay\", + \"HighDemandDelay\", and \"LargeNumberOfFilesDelay\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """Description of the delay.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """Timestamp when the delay notification was created.""" + resolution_time: Optional[datetime.datetime] = rest_field( + name="resolutionTime", visibility=["read"], format="rfc3339" + ) + """Timestamp when the delay notification was resolved.""" + + +class JobDeliveryInfo(_Model): + """Additional delivery info. + + :ivar scheduled_date_time: Scheduled date time. + :vartype scheduled_date_time: ~datetime.datetime + """ + + scheduled_date_time: Optional[datetime.datetime] = rest_field( + name="scheduledDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Scheduled date time.""" + + @overload + def __init__( + self, + *, + scheduled_date_time: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobProperties(_Model): + """Job Properties. + + :ivar transfer_type: Type of the data transfer. Required. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.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. + :vartype is_shipping_address_editable: bool + :ivar reverse_shipping_details_update: The Editable status for Reverse Shipping Address and + Contact Info. Known values are: "Enabled", "Disabled", and "NotSupported". + :vartype reverse_shipping_details_update: str or + ~azure.mgmt.databox.models.ReverseShippingDetailsEditStatus + :ivar reverse_transport_preference_update: The Editable status for Reverse Transport + preferences. Known values are: "Enabled", "Disabled", and "NotSupported". + :vartype reverse_transport_preference_update: str or + ~azure.mgmt.databox.models.ReverseTransportPreferenceEditStatus + :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. Known values are: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", + "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", and "ShippedToCustomer". + :vartype status: str or ~azure.mgmt.databox.models.StageName + :ivar delayed_stage: Name of the stage where delay might be present. Known values are: + "DeviceOrdered", "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", + "DataCopy", "Completed", "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", + "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", and "ShippedToCustomer". + :vartype delayed_stage: 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.datetime + :ivar error: Top level error for the job. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar details: Details of a job run. This field will only be sent for expand details filter. + :vartype details: ~azure.mgmt.databox.models.JobDetails + :ivar cancellation_reason: Reason for cancellation. + :vartype cancellation_reason: str + :ivar delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". + :vartype delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType + :ivar delivery_info: Delivery Info of Job. + :vartype delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo + :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. + :vartype is_cancellable_without_fee: bool + :ivar all_devices_lost: Flag to indicate if all devices associated with the job are lost. + :vartype all_devices_lost: bool + """ + + transfer_type: Union[str, "_models.TransferType"] = rest_field( + name="transferType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the data transfer. Required. Known values are: \"ImportToAzure\" and + \"ExportFromAzure\".""" + is_cancellable: Optional[bool] = rest_field(name="isCancellable", visibility=["read"]) + """Describes whether the job is cancellable or not.""" + is_deletable: Optional[bool] = rest_field(name="isDeletable", visibility=["read"]) + """Describes whether the job is deletable or not.""" + is_shipping_address_editable: Optional[bool] = rest_field(name="isShippingAddressEditable", visibility=["read"]) + """Describes whether the shipping address is editable or not.""" + reverse_shipping_details_update: Optional[Union[str, "_models.ReverseShippingDetailsEditStatus"]] = rest_field( + name="reverseShippingDetailsUpdate", visibility=["read"] + ) + """The Editable status for Reverse Shipping Address and Contact Info. Known values are: + \"Enabled\", \"Disabled\", and \"NotSupported\".""" + reverse_transport_preference_update: Optional[Union[str, "_models.ReverseTransportPreferenceEditStatus"]] = ( + rest_field(name="reverseTransportPreferenceUpdate", visibility=["read"]) + ) + """The Editable status for Reverse Transport preferences. Known values are: \"Enabled\", + \"Disabled\", and \"NotSupported\".""" + is_prepare_to_ship_enabled: Optional[bool] = rest_field(name="isPrepareToShipEnabled", visibility=["read"]) + """Is Prepare To Ship Enabled on this job.""" + status: Optional[Union[str, "_models.StageName"]] = rest_field(visibility=["read"]) + """Name of the stage which is in progress. Known values are: \"DeviceOrdered\", + \"DevicePrepared\", \"Dispatched\", \"Delivered\", \"PickedUp\", \"AtAzureDC\", \"DataCopy\", + \"Completed\", \"CompletedWithErrors\", \"Cancelled\", \"Failed_IssueReportedAtCustomer\", + \"Failed_IssueDetectedAtAzureDC\", \"Aborted\", \"CompletedWithWarnings\", + \"ReadyToDispatchFromAzureDC\", \"ReadyToReceiveAtAzureDC\", \"Created\", \"ShippedToAzureDC\", + \"AwaitingShipmentDetails\", \"PreparingToShipFromAzureDC\", and \"ShippedToCustomer\".""" + delayed_stage: Optional[Union[str, "_models.StageName"]] = rest_field(name="delayedStage", visibility=["read"]) + """Name of the stage where delay might be present. Known values are: \"DeviceOrdered\", + \"DevicePrepared\", \"Dispatched\", \"Delivered\", \"PickedUp\", \"AtAzureDC\", \"DataCopy\", + \"Completed\", \"CompletedWithErrors\", \"Cancelled\", \"Failed_IssueReportedAtCustomer\", + \"Failed_IssueDetectedAtAzureDC\", \"Aborted\", \"CompletedWithWarnings\", + \"ReadyToDispatchFromAzureDC\", \"ReadyToReceiveAtAzureDC\", \"Created\", \"ShippedToAzureDC\", + \"AwaitingShipmentDetails\", \"PreparingToShipFromAzureDC\", and \"ShippedToCustomer\".""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """Time at which the job was started in UTC ISO 8601 format.""" + error: Optional["_models.CloudError"] = rest_field(visibility=["read"]) + """Top level error for the job.""" + details: Optional["_models.JobDetails"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Details of a job run. This field will only be sent for expand details filter.""" + cancellation_reason: Optional[str] = rest_field(name="cancellationReason", visibility=["read"]) + """Reason for cancellation.""" + delivery_type: Optional[Union[str, "_models.JobDeliveryType"]] = rest_field( + name="deliveryType", visibility=["read", "create", "update", "delete", "query"] + ) + """Delivery type of Job. Known values are: \"NonScheduled\" and \"Scheduled\".""" + delivery_info: Optional["_models.JobDeliveryInfo"] = rest_field( + name="deliveryInfo", visibility=["read", "create", "update", "delete", "query"] + ) + """Delivery Info of Job.""" + is_cancellable_without_fee: Optional[bool] = rest_field(name="isCancellableWithoutFee", visibility=["read"]) + """Flag to indicate cancellation of scheduled job.""" + all_devices_lost: Optional[bool] = rest_field(name="allDevicesLost", visibility=["read"]) + """Flag to indicate if all devices associated with the job are lost.""" + + @overload + def __init__( + self, + *, + transfer_type: Union[str, "_models.TransferType"], + details: Optional["_models.JobDetails"] = None, + delivery_type: Optional[Union[str, "_models.JobDeliveryType"]] = None, + delivery_info: Optional["_models.JobDeliveryInfo"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Resource(_Model): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.databox.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.databox.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobResource(TrackedResource): + """Job Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.databox.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Properties of a job. Required. + :vartype properties: ~azure.mgmt.databox.models.JobProperties + :ivar sku: The sku type. Required. + :vartype sku: ~azure.mgmt.databox.models.Sku + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.models.ResourceIdentity + """ + + properties: "_models.JobProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Properties of a job. Required.""" + sku: "_models.Sku" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sku type. Required.""" + identity: Optional["_models.ResourceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Msi identity of the resource.""" + + __flattened_items = [ + "transfer_type", + "is_cancellable", + "is_deletable", + "is_shipping_address_editable", + "reverse_shipping_details_update", + "reverse_transport_preference_update", + "is_prepare_to_ship_enabled", + "status", + "delayed_stage", + "start_time", + "error", + "details", + "cancellation_reason", + "delivery_type", + "delivery_info", + "is_cancellable_without_fee", + "all_devices_lost", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.JobProperties", + sku: "_models.Sku", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ResourceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class JobResourceUpdateParameter(_Model): + """The JobResourceUpdateParameter. + + :ivar properties: Properties of a job to be updated. + :vartype properties: ~azure.mgmt.databox.models.UpdateJobProperties + :ivar 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). + :vartype tags: dict[str, str] + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.models.ResourceIdentity + """ + + properties: Optional["_models.UpdateJobProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of a job to be updated.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The list of key value pairs that describe the resource. These tags can be used in viewing and + grouping this resource (across resource groups).""" + identity: Optional["_models.ResourceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Msi identity of the resource.""" + + __flattened_items = ["details"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.UpdateJobProperties"] = None, + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ResourceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class JobStages(_Model): + """Job stages. + + :ivar stage_name: Name of the job stage. Known values are: "DeviceOrdered", "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", + "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", and "ShippedToCustomer". + :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + :ivar display_name: Display name of the job stage. + :vartype display_name: str + :ivar stage_status: Status of the job stage. Known values are: "None", "InProgress", + "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", + "WaitingForCustomerAction", "SucceededWithWarnings", "WaitingForCustomerActionForKek", + "WaitingForCustomerActionForCleanUp", "CustomerActionPerformedForCleanUp", and + "CustomerActionPerformed". + :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :ivar stage_time: Time for the job stage in UTC ISO 8601 format. + :vartype stage_time: ~datetime.datetime + :ivar job_stage_details: Job Stage Details. + :vartype job_stage_details: any + :ivar delay_information: Delay information for the job stages. + :vartype delay_information: list[~azure.mgmt.databox.models.JobDelayDetails] + """ + + stage_name: Optional[Union[str, "_models.StageName"]] = rest_field(name="stageName", visibility=["read"]) + """Name of the job stage. Known values are: \"DeviceOrdered\", \"DevicePrepared\", \"Dispatched\", + \"Delivered\", \"PickedUp\", \"AtAzureDC\", \"DataCopy\", \"Completed\", + \"CompletedWithErrors\", \"Cancelled\", \"Failed_IssueReportedAtCustomer\", + \"Failed_IssueDetectedAtAzureDC\", \"Aborted\", \"CompletedWithWarnings\", + \"ReadyToDispatchFromAzureDC\", \"ReadyToReceiveAtAzureDC\", \"Created\", \"ShippedToAzureDC\", + \"AwaitingShipmentDetails\", \"PreparingToShipFromAzureDC\", and \"ShippedToCustomer\".""" + display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) + """Display name of the job stage.""" + stage_status: Optional[Union[str, "_models.StageStatus"]] = rest_field(name="stageStatus", visibility=["read"]) + """Status of the job stage. Known values are: \"None\", \"InProgress\", \"Succeeded\", \"Failed\", + \"Cancelled\", \"Cancelling\", \"SucceededWithErrors\", \"WaitingForCustomerAction\", + \"SucceededWithWarnings\", \"WaitingForCustomerActionForKek\", + \"WaitingForCustomerActionForCleanUp\", \"CustomerActionPerformedForCleanUp\", and + \"CustomerActionPerformed\".""" + stage_time: Optional[datetime.datetime] = rest_field(name="stageTime", visibility=["read"], format="rfc3339") + """Time for the job stage in UTC ISO 8601 format.""" + job_stage_details: Optional[Any] = rest_field(name="jobStageDetails", visibility=["read"]) + """Job Stage Details.""" + delay_information: Optional[list["_models.JobDelayDetails"]] = rest_field( + name="delayInformation", visibility=["read"] + ) + """Delay information for the job stages.""" + + +class KeyEncryptionKey(_Model): + """Encryption key containing details about key to encrypt different keys. + + :ivar kek_type: Type of encryption key used for key encryption. Required. Known values are: + "MicrosoftManaged" and "CustomerManaged". + :vartype kek_type: str or ~azure.mgmt.databox.models.KekType + :ivar identity_properties: Managed identity properties used for key encryption. + :vartype identity_properties: ~azure.mgmt.databox.models.IdentityProperties + :ivar kek_url: Key encryption key. It is required in case of Customer managed KekType. + :vartype kek_url: str + :ivar kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + KekType. + :vartype kek_vault_resource_id: str + """ + + kek_type: Union[str, "_models.KekType"] = rest_field( + name="kekType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of encryption key used for key encryption. Required. Known values are: + \"MicrosoftManaged\" and \"CustomerManaged\".""" + identity_properties: Optional["_models.IdentityProperties"] = rest_field( + name="identityProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Managed identity properties used for key encryption.""" + kek_url: Optional[str] = rest_field(name="kekUrl", visibility=["read", "create", "update", "delete", "query"]) + """Key encryption key. It is required in case of Customer managed KekType.""" + kek_vault_resource_id: Optional[str] = rest_field( + name="kekVaultResourceID", visibility=["read", "create", "update", "delete", "query"] + ) + """Kek vault resource id. It is required in case of Customer managed KekType.""" + + @overload + def __init__( + self, + *, + kek_type: Union[str, "_models.KekType"], + identity_properties: Optional["_models.IdentityProperties"] = None, + kek_url: Optional[str] = None, + kek_vault_resource_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LastMitigationActionOnJob(_Model): + """Last Mitigation Action Performed On Job. + + :ivar action_date_time_in_utc: Action performed date time. + :vartype action_date_time_in_utc: ~datetime.datetime + :ivar is_performed_by_customer: Action performed by customer, possibility is that mitigation + might happen by customer or service or by ops. + :vartype is_performed_by_customer: bool + :ivar customer_resolution: Resolution code provided by customer. Known values are: "None", + "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". + :vartype customer_resolution: str or ~azure.mgmt.databox.models.CustomerResolutionCode + """ + + action_date_time_in_utc: Optional[datetime.datetime] = rest_field( + name="actionDateTimeInUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Action performed date time.""" + is_performed_by_customer: Optional[bool] = rest_field( + name="isPerformedByCustomer", visibility=["read", "create", "update", "delete", "query"] + ) + """Action performed by customer, possibility is that mitigation might happen by customer or + service or by ops.""" + customer_resolution: Optional[Union[str, "_models.CustomerResolutionCode"]] = rest_field( + name="customerResolution", visibility=["read", "create", "update", "delete", "query"] + ) + """Resolution code provided by customer. Known values are: \"None\", \"MoveToCleanUpDevice\", + \"Resume\", \"Restart\", and \"ReachOutToOperation\".""" + + @overload + def __init__( + self, + *, + action_date_time_in_utc: Optional[datetime.datetime] = None, + is_performed_by_customer: Optional[bool] = None, + customer_resolution: Optional[Union[str, "_models.CustomerResolutionCode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedDiskDetails(DataAccountDetails, discriminator="ManagedDisk"): + """Details of the managed disks. + + :ivar 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 : @#\\-$%^!+=;:_()]+. + :vartype share_password: str + :ivar resource_group_id: Resource Group Id of the compute disks. Required. + :vartype resource_group_id: str + :ivar staging_storage_account_id: Resource Id of the storage account that can be used to copy + the vhd for staging. Required. + :vartype staging_storage_account_id: str + :ivar data_account_type: Account Type of the data to be transferred. Required. Azure Managed + disk storage. + :vartype data_account_type: str or ~azure.mgmt.databox.models.MANAGED_DISK + """ + + resource_group_id: str = rest_field( + name="resourceGroupId", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource Group Id of the compute disks. Required.""" + staging_storage_account_id: str = rest_field( + name="stagingStorageAccountId", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource Id of the storage account that can be used to copy the vhd for staging. Required.""" + data_account_type: Literal[DataAccountType.MANAGED_DISK] = rest_discriminator(name="dataAccountType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Account Type of the data to be transferred. Required. Azure Managed disk storage.""" + + @overload + def __init__( + self, + *, + resource_group_id: str, + staging_storage_account_id: str, + share_password: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.data_account_type = DataAccountType.MANAGED_DISK # type: ignore + + +class MarkDevicesShippedRequest(_Model): + """The request body to provide the delivery package details of job. + + :ivar deliver_to_dc_package_details: Delivery package details. Required. + :vartype deliver_to_dc_package_details: ~azure.mgmt.databox.models.PackageCarrierInfo + """ + + deliver_to_dc_package_details: "_models.PackageCarrierInfo" = rest_field( + name="deliverToDcPackageDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Delivery package details. Required.""" + + @overload + def __init__( + self, + *, + deliver_to_dc_package_details: "_models.PackageCarrierInfo", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MitigateJobRequest(_Model): + """The Mitigate Job captured from request body for Mitigate API. + + :ivar customer_resolution_code: Resolution code for the job. Known values are: "None", + "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". + :vartype customer_resolution_code: str or ~azure.mgmt.databox.models.CustomerResolutionCode + :ivar serial_number_customer_resolution_map: Serial number and the customer resolution code + corresponding to each serial number. + :vartype serial_number_customer_resolution_map: dict[str, str or + ~azure.mgmt.databox.models.CustomerResolutionCode] + """ + + customer_resolution_code: Optional[Union[str, "_models.CustomerResolutionCode"]] = rest_field( + name="customerResolutionCode", visibility=["read", "create", "update", "delete", "query"] + ) + """Resolution code for the job. Known values are: \"None\", \"MoveToCleanUpDevice\", \"Resume\", + \"Restart\", and \"ReachOutToOperation\".""" + serial_number_customer_resolution_map: Optional[dict[str, Union[str, "_models.CustomerResolutionCode"]]] = ( + rest_field(name="serialNumberCustomerResolutionMap", visibility=["read", "create", "update", "delete", "query"]) + ) + """Serial number and the customer resolution code corresponding to each serial number.""" + + @overload + def __init__( + self, + *, + customer_resolution_code: Optional[Union[str, "_models.CustomerResolutionCode"]] = None, + serial_number_customer_resolution_map: Optional[dict[str, Union[str, "_models.CustomerResolutionCode"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NotificationPreference(_Model): + """Notification preference for a job stage. + + :ivar stage_name: Name of the stage. Required. Known values are: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Created", and + "ShippedToCustomer". + :vartype stage_name: str or ~azure.mgmt.databox.models.NotificationStageName + :ivar send_notification: Notification is required or not. Required. + :vartype send_notification: bool + """ + + stage_name: Union[str, "_models.NotificationStageName"] = rest_field( + name="stageName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the stage. Required. Known values are: \"DevicePrepared\", \"Dispatched\", + \"Delivered\", \"PickedUp\", \"AtAzureDC\", \"DataCopy\", \"Created\", and + \"ShippedToCustomer\".""" + send_notification: bool = rest_field( + name="sendNotification", visibility=["read", "create", "update", "delete", "query"] + ) + """Notification is required or not. Required.""" + + @overload + def __init__( + self, + *, + stage_name: Union[str, "_models.NotificationStageName"], + send_notification: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Operation(_Model): + """Operation entity. + + :ivar name: Name of the operation. Format: + {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. + :vartype name: str + :ivar display: Operation display values. + :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :ivar properties: Operation properties. + :vartype properties: ~azure.mgmt.databox.models.OperationProperties + :ivar origin: Origin of the operation. Can be : user|system|user,system. + :vartype origin: str + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Name of the operation. Format: + {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}.""" + display: Optional["_models.OperationDisplay"] = rest_field(visibility=["read"]) + """Operation display values.""" + properties: Optional["_models.OperationProperties"] = rest_field(visibility=["read"]) + """Operation properties.""" + origin: Optional[str] = rest_field(visibility=["read"]) + """Origin of the operation. Can be : user|system|user,system.""" + is_data_action: Optional[bool] = rest_field( + name="isDataAction", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether the operation is a data action.""" + + __flattened_items = [""] + + @overload + def __init__( + self, + *, + is_data_action: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class OperationDisplay(_Model): + """Operation display. + + :ivar provider: Provider name. + :vartype provider: str + :ivar resource: Resource name. + :vartype resource: str + :ivar operation: Localized name of the operation for display purpose. + :vartype operation: str + :ivar description: Localized description of the operation for display purpose. + :vartype description: str + """ + + provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Provider name.""" + resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource name.""" + operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Localized name of the operation for display purpose.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Localized description of the operation for display purpose.""" + + @overload + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationProperties(_Model): + """Operation properties.""" + + +class PackageCarrierDetails(_Model): + """Package carrier details. + + :ivar carrier_account_number: Carrier Account Number of customer for customer disk. + :vartype carrier_account_number: str + :ivar carrier_name: Name of the carrier. + :vartype carrier_name: str + :ivar tracking_id: Tracking Id of shipment. + :vartype tracking_id: str + """ + + carrier_account_number: Optional[str] = rest_field( + name="carrierAccountNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Carrier Account Number of customer for customer disk.""" + carrier_name: Optional[str] = rest_field( + name="carrierName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the carrier.""" + tracking_id: Optional[str] = rest_field( + name="trackingId", visibility=["read", "create", "update", "delete", "query"] + ) + """Tracking Id of shipment.""" + + @overload + def __init__( + self, + *, + carrier_account_number: Optional[str] = None, + carrier_name: Optional[str] = None, + tracking_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PackageCarrierInfo(_Model): + """package carrier info. + + :ivar carrier_name: Name of the carrier. + :vartype carrier_name: str + :ivar tracking_id: Tracking Id of shipment. + :vartype tracking_id: str + """ + + carrier_name: Optional[str] = rest_field( + name="carrierName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the carrier.""" + tracking_id: Optional[str] = rest_field( + name="trackingId", visibility=["read", "create", "update", "delete", "query"] + ) + """Tracking Id of shipment.""" + + @overload + def __init__( + self, + *, + carrier_name: Optional[str] = None, + tracking_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PackageShippingDetails(_Model): + """package shipping details. + + :ivar tracking_url: Url where shipment can be tracked. + :vartype tracking_url: str + :ivar carrier_name: Name of the carrier. + :vartype carrier_name: str + :ivar tracking_id: Tracking Id of shipment. + :vartype tracking_id: str + """ + + tracking_url: Optional[str] = rest_field(name="trackingUrl", visibility=["read"]) + """Url where shipment can be tracked.""" + carrier_name: Optional[str] = rest_field(name="carrierName", visibility=["read"]) + """Name of the carrier.""" + tracking_id: Optional[str] = rest_field(name="trackingId", visibility=["read"]) + """Tracking Id of shipment.""" + + +class Preferences(_Model): + """Preferences related to the order. + + :ivar preferred_data_center_region: Preferred data center region. + :vartype preferred_data_center_region: list[str] + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :ivar reverse_transport_preferences: Optional Preferences related to the reverse shipment + logistics of the sku. + :vartype reverse_transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :ivar encryption_preferences: Preferences related to the Encryption. + :vartype encryption_preferences: ~azure.mgmt.databox.models.EncryptionPreferences + :ivar storage_account_access_tier_preferences: Preferences related to the Access Tier of + storage accounts. + :vartype storage_account_access_tier_preferences: list[str] + """ + + preferred_data_center_region: Optional[list[str]] = rest_field( + name="preferredDataCenterRegion", visibility=["read", "create", "update", "delete", "query"] + ) + """Preferred data center region.""" + transport_preferences: Optional["_models.TransportPreferences"] = rest_field( + name="transportPreferences", visibility=["read", "create", "update", "delete", "query"] + ) + """Preferences related to the shipment logistics of the sku.""" + reverse_transport_preferences: Optional["_models.TransportPreferences"] = rest_field( + name="reverseTransportPreferences", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional Preferences related to the reverse shipment logistics of the sku.""" + encryption_preferences: Optional["_models.EncryptionPreferences"] = rest_field( + name="encryptionPreferences", visibility=["read", "create", "update", "delete", "query"] + ) + """Preferences related to the Encryption.""" + storage_account_access_tier_preferences: Optional[list[Literal["Archive"]]] = rest_field( + name="storageAccountAccessTierPreferences", visibility=["read", "create", "update", "delete", "query"] + ) + """Preferences related to the Access Tier of storage accounts.""" + + @overload + def __init__( + self, + *, + preferred_data_center_region: Optional[list[str]] = None, + transport_preferences: Optional["_models.TransportPreferences"] = None, + reverse_transport_preferences: Optional["_models.TransportPreferences"] = None, + encryption_preferences: Optional["_models.EncryptionPreferences"] = None, + storage_account_access_tier_preferences: Optional[list[Literal["Archive"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PreferencesValidationRequest(ValidationInputRequest, discriminator="ValidatePreferences"): + """Request to validate preference of transport and data center. + + :ivar preference: Preference of transport and data center. + :vartype preference: ~azure.mgmt.databox.models.Preferences + :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", + "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype device_type: str or ~azure.mgmt.databox.models.SkuName + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response of preference validation. + :vartype validation_type: str or ~azure.mgmt.databox.models.VALIDATE_PREFERENCES + """ + + preference: Optional["_models.Preferences"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Preference of transport and data center.""" + device_type: Union[str, "_models.SkuName"] = rest_field( + name="deviceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Device type to be used for the job. Required. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + model: Optional[Union[str, "_models.ModelName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation request. Required. Identify request and response of + preference validation.""" + + @overload + def __init__( + self, + *, + device_type: Union[str, "_models.SkuName"], + preference: Optional["_models.Preferences"] = None, + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_PREFERENCES # type: ignore + + +class PreferencesValidationResponseProperties(ValidationInputResponse, discriminator="ValidatePreferences"): + """Properties of data center and transport preference validation response. + + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar status: Validation status of requested data center and transport. Known values are: + "Valid", "Invalid", and "Skipped". + :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response of preference validation. + :vartype validation_type: str or ~azure.mgmt.databox.models.VALIDATE_PREFERENCES + """ + + status: Optional[Union[str, "_models.ValidationStatus"]] = rest_field(visibility=["read"]) + """Validation status of requested data center and transport. Known values are: \"Valid\", + \"Invalid\", and \"Skipped\".""" + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation response. Required. Identify request and response of + preference validation.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_PREFERENCES # type: ignore + + +class RegionConfigurationRequest(_Model): + """Request body to get the configuration for the region. + + :ivar schedule_availability_request: Request body to get the availability for scheduling + orders. + :vartype schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest + :ivar transport_availability_request: Request body to get the transport availability for given + sku. + :vartype transport_availability_request: + ~azure.mgmt.databox.models.TransportAvailabilityRequest + :ivar datacenter_address_request: Request body to get the datacenter address for given sku. + :vartype datacenter_address_request: ~azure.mgmt.databox.models.DatacenterAddressRequest + :ivar device_capability_request: Request body to get the device capabilities for a given sku. + :vartype device_capability_request: ~azure.mgmt.databox.models.DeviceCapabilityRequest + """ + + schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = rest_field( + name="scheduleAvailabilityRequest", visibility=["read", "create", "update", "delete", "query"] + ) + """Request body to get the availability for scheduling orders.""" + transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = rest_field( + name="transportAvailabilityRequest", visibility=["read", "create", "update", "delete", "query"] + ) + """Request body to get the transport availability for given sku.""" + datacenter_address_request: Optional["_models.DatacenterAddressRequest"] = rest_field( + name="datacenterAddressRequest", visibility=["read", "create", "update", "delete", "query"] + ) + """Request body to get the datacenter address for given sku.""" + device_capability_request: Optional["_models.DeviceCapabilityRequest"] = rest_field( + name="deviceCapabilityRequest", visibility=["read", "create", "update", "delete", "query"] + ) + """Request body to get the device capabilities for a given sku.""" + + @overload + def __init__( + self, + *, + schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, + transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, + datacenter_address_request: Optional["_models.DatacenterAddressRequest"] = None, + device_capability_request: Optional["_models.DeviceCapabilityRequest"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RegionConfigurationResponse(_Model): + """Configuration response specific to 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. + :vartype transport_availability_response: + ~azure.mgmt.databox.models.TransportAvailabilityResponse + :ivar datacenter_address_response: Datacenter address for given sku in a region. + :vartype datacenter_address_response: ~azure.mgmt.databox.models.DatacenterAddressResponse + :ivar device_capability_response: Device capabilities available for a given sku in a region. + :vartype device_capability_response: ~azure.mgmt.databox.models.DeviceCapabilityResponse + """ + + schedule_availability_response: Optional["_models.ScheduleAvailabilityResponse"] = rest_field( + name="scheduleAvailabilityResponse", visibility=["read"] + ) + """Schedule availability for given sku in a region.""" + transport_availability_response: Optional["_models.TransportAvailabilityResponse"] = rest_field( + name="transportAvailabilityResponse", visibility=["read"] + ) + """Transport options available for given sku in a region.""" + datacenter_address_response: Optional["_models.DatacenterAddressResponse"] = rest_field( + name="datacenterAddressResponse", visibility=["read"] + ) + """Datacenter address for given sku in a region.""" + device_capability_response: Optional["_models.DeviceCapabilityResponse"] = rest_field( + name="deviceCapabilityResponse", visibility=["read"] + ) + """Device capabilities available for a given sku in a region.""" + + +class ResourceIdentity(_Model): + """Msi identity details of the resource. + + :ivar type: Identity type. + :vartype 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 + :ivar user_assigned_identities: User Assigned Identities. + :vartype user_assigned_identities: dict[str, ~azure.mgmt.databox.models.UserAssignedIdentity] + """ + + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identity type.""" + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """Service Principal Id backing the Msi.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """Home Tenant Id.""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """User Assigned Identities.""" + + @overload + def __init__( + self, + *, + type: Optional[str] = None, + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ReverseShippingDetails(_Model): + """Reverse Shipping Address and contact details for a job. + + :ivar contact_details: Contact Info. + :vartype contact_details: ~azure.mgmt.databox.models.ContactInfo + :ivar shipping_address: Shipping address where customer wishes to receive the device. + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :ivar is_updated: A flag to indicate whether Reverse Shipping details are updated or not after + device has been prepared. Read only field. + :vartype is_updated: bool + """ + + contact_details: Optional["_models.ContactInfo"] = rest_field( + name="contactDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Contact Info.""" + shipping_address: Optional["_models.ShippingAddress"] = rest_field( + name="shippingAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Shipping address where customer wishes to receive the device.""" + is_updated: Optional[bool] = rest_field(name="isUpdated", visibility=["read"]) + """A flag to indicate whether Reverse Shipping details are updated or not after device has been + prepared. Read only field.""" + + @overload + def __init__( + self, + *, + contact_details: Optional["_models.ContactInfo"] = None, + shipping_address: Optional["_models.ShippingAddress"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScheduleAvailabilityResponse(_Model): + """Schedule availability for given sku in a region. + + :ivar available_dates: List of dates available to schedule. + :vartype available_dates: list[~datetime.datetime] + """ + + available_dates: Optional[list[datetime.datetime]] = rest_field( + name="availableDates", visibility=["read"], format="rfc3339" + ) + """List of dates available to schedule.""" + + +class ShareCredentialDetails(_Model): + """Credential details of the shares in account. + + :ivar share_name: Name of the share. + :vartype share_name: str + :ivar share_type: Type of the share. Known values are: "UnknownType", "HCS", "BlockBlob", + "PageBlob", "AzureFile", and "ManagedDisk". + :vartype share_type: str or ~azure.mgmt.databox.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. + :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] + """ + + share_name: Optional[str] = rest_field(name="shareName", visibility=["read"]) + """Name of the share.""" + share_type: Optional[Union[str, "_models.ShareDestinationFormatType"]] = rest_field( + name="shareType", visibility=["read"] + ) + """Type of the share. Known values are: \"UnknownType\", \"HCS\", \"BlockBlob\", \"PageBlob\", + \"AzureFile\", and \"ManagedDisk\".""" + user_name: Optional[str] = rest_field(name="userName", visibility=["read"]) + """User name for the share.""" + password: Optional[str] = rest_field(visibility=["read"]) + """Password for the share.""" + supported_access_protocols: Optional[list[Union[str, "_models.AccessProtocol"]]] = rest_field( + name="supportedAccessProtocols", visibility=["read"] + ) + """Access protocols supported on the device.""" + + +class ShipmentPickUpRequest(_Model): + """Shipment pick up request details. + + :ivar start_time: Minimum date after which the pick up should commence, this must be in local + time of pick up area. Required. + :vartype start_time: ~datetime.datetime + :ivar end_time: Maximum date before which the pick up should commence, this must be in local + time of pick up area. Required. + :vartype end_time: ~datetime.datetime + :ivar shipment_location: Shipment Location in the pickup place. Eg.front desk. Required. + :vartype shipment_location: str + """ + + start_time: datetime.datetime = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Minimum date after which the pick up should commence, this must be in local time of pick up + area. Required.""" + end_time: datetime.datetime = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Maximum date before which the pick up should commence, this must be in local time of pick up + area. Required.""" + shipment_location: str = rest_field( + name="shipmentLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Shipment Location in the pickup place. Eg.front desk. Required.""" + + @overload + def __init__( + self, + *, + start_time: datetime.datetime, + end_time: datetime.datetime, + shipment_location: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ShipmentPickUpResponse(_Model): + """Shipment pick up response. + + :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.datetime + """ + + confirmation_number: Optional[str] = rest_field(name="confirmationNumber", visibility=["read"]) + """Confirmation number for the pick up request.""" + ready_by_time: Optional[datetime.datetime] = rest_field(name="readyByTime", visibility=["read"], format="rfc3339") + """Time by which shipment should be ready for pick up, this is in local time of pick up area.""" + + +class ShippingAddress(_Model): + """Shipping address where customer wishes to receive the device. + + :ivar street_address1: Street Address line 1. Required. + :vartype street_address1: str + :ivar street_address2: Street Address line 2. + :vartype street_address2: str + :ivar street_address3: Street Address line 3. + :vartype street_address3: str + :ivar city: Name of the City. + :vartype city: str + :ivar state_or_province: Name of the State or Province. + :vartype state_or_province: str + :ivar country: Name of the Country. Required. + :vartype country: str + :ivar postal_code: Postal code. + :vartype postal_code: str + :ivar zip_extended_code: Extended Zip Code. + :vartype zip_extended_code: str + :ivar company_name: Name of the company. + :vartype company_name: str + :ivar address_type: Type of address. Known values are: "None", "Residential", and "Commercial". + :vartype address_type: str or ~azure.mgmt.databox.models.AddressType + :ivar skip_address_validation: Flag to indicate if customer has chosen to skip default address + validation. + :vartype skip_address_validation: bool + :ivar tax_identification_number: Tax Identification Number. + :vartype tax_identification_number: str + """ + + street_address1: str = rest_field(name="streetAddress1", visibility=["read", "create", "update", "delete", "query"]) + """Street Address line 1. Required.""" + street_address2: Optional[str] = rest_field( + name="streetAddress2", visibility=["read", "create", "update", "delete", "query"] + ) + """Street Address line 2.""" + street_address3: Optional[str] = rest_field( + name="streetAddress3", visibility=["read", "create", "update", "delete", "query"] + ) + """Street Address line 3.""" + city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the City.""" + state_or_province: Optional[str] = rest_field( + name="stateOrProvince", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the State or Province.""" + country: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the Country. Required.""" + postal_code: Optional[str] = rest_field( + name="postalCode", visibility=["read", "create", "update", "delete", "query"] + ) + """Postal code.""" + zip_extended_code: Optional[str] = rest_field( + name="zipExtendedCode", visibility=["read", "create", "update", "delete", "query"] + ) + """Extended Zip Code.""" + company_name: Optional[str] = rest_field( + name="companyName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the company.""" + address_type: Optional[Union[str, "_models.AddressType"]] = rest_field( + name="addressType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of address. Known values are: \"None\", \"Residential\", and \"Commercial\".""" + skip_address_validation: Optional[bool] = rest_field( + name="skipAddressValidation", visibility=["read", "create", "update", "delete", "query"] + ) + """Flag to indicate if customer has chosen to skip default address validation.""" + tax_identification_number: Optional[str] = rest_field( + name="taxIdentificationNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Tax Identification Number.""" + + @overload + 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, "_models.AddressType"]] = None, + skip_address_validation: Optional[bool] = None, + tax_identification_number: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Sku(_Model): + """The Sku. + + :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", + and "DataBoxCustomerDisk". + :vartype name: str or ~azure.mgmt.databox.models.SkuName + :ivar display_name: The display name of the sku. + :vartype display_name: str + :ivar family: The sku family. + :vartype family: str + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + """ + + name: Union[str, "_models.SkuName"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sku name. Required. Known values are: \"DataBox\", \"DataBoxDisk\", \"DataBoxHeavy\", and + \"DataBoxCustomerDisk\".""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """The display name of the sku.""" + family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sku family.""" + model: Optional[Union[str, "_models.ModelName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + + @overload + def __init__( + self, + *, + name: Union[str, "_models.SkuName"], + display_name: Optional[str] = None, + family: Optional[str] = None, + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SkuAvailabilityValidationRequest(ValidationInputRequest, discriminator="ValidateSkuAvailability"): + """Request to validate sku availability. + + :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", + "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype device_type: str or ~azure.mgmt.databox.models.SkuName + :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType + :ivar country: ISO country code. Country for hardware shipment. For codes check: + `https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + `_. + Required. + :vartype country: str + :ivar location: Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype location: str + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response of active job limit for sku availability. + :vartype validation_type: str or ~azure.mgmt.databox.models.VALIDATE_SKU_AVAILABILITY + """ + + device_type: Union[str, "_models.SkuName"] = rest_field( + name="deviceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Device type to be used for the job. Required. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + transfer_type: Union[str, "_models.TransferType"] = rest_field( + name="transferType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the transfer. Required. Known values are: \"ImportToAzure\" and \"ExportFromAzure\".""" + country: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """ISO country code. Country for hardware shipment. For codes check: + `https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + `_. + Required.""" + location: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required.""" + model: Optional[Union[str, "_models.ModelName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation request. Required. Identify request and response of active + job limit for sku availability.""" + + @overload + def __init__( + self, + *, + device_type: Union[str, "_models.SkuName"], + transfer_type: Union[str, "_models.TransferType"], + country: str, + location: str, + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY # type: ignore + + +class SkuAvailabilityValidationResponseProperties( + ValidationInputResponse, discriminator="ValidateSkuAvailability" +): # pylint: disable=name-too-long + """Properties of sku availability validation response. + + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and + "Skipped". + :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response of active job limit for sku availability. + :vartype validation_type: str or ~azure.mgmt.databox.models.VALIDATE_SKU_AVAILABILITY + """ + + status: Optional[Union[str, "_models.ValidationStatus"]] = rest_field(visibility=["read"]) + """Sku availability validation status. Known values are: \"Valid\", \"Invalid\", and \"Skipped\".""" + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation response. Required. Identify request and response of active + job limit for sku availability.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY # type: ignore + + +class SkuCapacity(_Model): + """Capacity of the sku. + + :ivar usable: Usable capacity in TB. + :vartype usable: str + :ivar maximum: Maximum capacity in TB. + :vartype maximum: str + :ivar individual_sku_usable: Maximum capacity per device in TB. + :vartype individual_sku_usable: str + """ + + usable: Optional[str] = rest_field(visibility=["read"]) + """Usable capacity in TB.""" + maximum: Optional[str] = rest_field(visibility=["read"]) + """Maximum capacity in TB.""" + individual_sku_usable: Optional[str] = rest_field(name="individualSkuUsable", visibility=["read"]) + """Maximum capacity per device in TB.""" + + +class SkuCost(_Model): + """Describes metadata for retrieving price info. + + :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 + """ + + meter_id: Optional[str] = rest_field(name="meterId", visibility=["read"]) + """Meter id of the Sku.""" + meter_type: Optional[str] = rest_field(name="meterType", visibility=["read"]) + """The type of the meter.""" + multiplier: Optional[float] = rest_field(visibility=["read"]) + """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.""" + + +class SkuInformation(_Model): + """Information of the sku. + + :ivar sku: The Sku. + :vartype sku: ~azure.mgmt.databox.models.Sku + :ivar enabled: The sku is enabled or not. + :vartype enabled: bool + :ivar properties: Properties of the sku. + :vartype properties: ~azure.mgmt.databox.models.SkuProperties + """ + + sku: Optional["_models.Sku"] = rest_field(visibility=["read"]) + """The Sku.""" + enabled: Optional[bool] = rest_field(visibility=["read"]) + """The sku is enabled or not.""" + properties: Optional["_models.SkuProperties"] = rest_field(visibility=["read"]) + """Properties of the sku.""" + + __flattened_items = [ + "data_location_to_service_location_map", + "capacity", + "costs", + "api_versions", + "disabled_reason", + "disabled_reason_message", + "required_feature", + "countries_within_commerce_boundary", + ] + + +class SkuProperties(_Model): + """Properties of the sku. + + :ivar data_location_to_service_location_map: The map of data location to service location. + :vartype data_location_to_service_location_map: + list[~azure.mgmt.databox.models.DataLocationToServiceLocationMap] + :ivar capacity: Capacity of the Sku. + :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :ivar costs: Cost of the Sku. + :vartype costs: list[~azure.mgmt.databox.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. Known values are: "None", "Country", + "Region", "Feature", "OfferType", and "NoSubscriptionInfo". + :vartype disabled_reason: str or ~azure.mgmt.databox.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. + :vartype required_feature: str + :ivar countries_within_commerce_boundary: List of all the Countries in the SKU specific + commerce boundary. + :vartype countries_within_commerce_boundary: list[str] + """ + + data_location_to_service_location_map: Optional[list["_models.DataLocationToServiceLocationMap"]] = rest_field( + name="dataLocationToServiceLocationMap", visibility=["read"] + ) + """The map of data location to service location.""" + capacity: Optional["_models.SkuCapacity"] = rest_field(visibility=["read"]) + """Capacity of the Sku.""" + costs: Optional[list["_models.SkuCost"]] = rest_field(visibility=["read"]) + """Cost of the Sku.""" + api_versions: Optional[list[str]] = rest_field(name="apiVersions", visibility=["read"]) + """Api versions that support this Sku.""" + disabled_reason: Optional[Union[str, "_models.SkuDisabledReason"]] = rest_field( + name="disabledReason", visibility=["read"] + ) + """Reason why the Sku is disabled. Known values are: \"None\", \"Country\", \"Region\", + \"Feature\", \"OfferType\", and \"NoSubscriptionInfo\".""" + disabled_reason_message: Optional[str] = rest_field(name="disabledReasonMessage", visibility=["read"]) + """Message for why the Sku is disabled.""" + required_feature: Optional[str] = rest_field(name="requiredFeature", visibility=["read"]) + """Required feature to access the sku.""" + countries_within_commerce_boundary: Optional[list[str]] = rest_field( + name="countriesWithinCommerceBoundary", visibility=["read"] + ) + """List of all the Countries in the SKU specific commerce boundary.""" + + +class StorageAccountDetails(DataAccountDetails, discriminator="StorageAccount"): + """Details for the storage account. + + :ivar 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 : @#\\-$%^!+=;:_()]+. + :vartype share_password: str + :ivar storage_account_id: Storage Account Resource Id. Required. + :vartype storage_account_id: str + :ivar data_account_type: Account Type of the data to be transferred. Required. Storage Accounts + . + :vartype data_account_type: str or ~azure.mgmt.databox.models.STORAGE_ACCOUNT + """ + + storage_account_id: str = rest_field( + name="storageAccountId", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage Account Resource Id. Required.""" + data_account_type: Literal[DataAccountType.STORAGE_ACCOUNT] = rest_discriminator(name="dataAccountType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Account Type of the data to be transferred. Required. Storage Accounts .""" + + @overload + def __init__( + self, + *, + storage_account_id: str, + share_password: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.data_account_type = DataAccountType.STORAGE_ACCOUNT # type: ignore + + +class SubscriptionIsAllowedToCreateJobValidationRequest( + ValidationInputRequest, discriminator="ValidateSubscriptionIsAllowedToCreateJob" +): # pylint: disable=name-too-long + """Request to validate subscription permission to create jobs. + + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response for validation of subscription permission to create job. + :vartype validation_type: str or + ~azure.mgmt.databox.models.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB + """ + + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation request. Required. Identify request and response for + validation of subscription permission to create job.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB # type: ignore + + +class SubscriptionIsAllowedToCreateJobValidationResponseProperties( + ValidationInputResponse, discriminator="ValidateSubscriptionIsAllowedToCreateJob" +): # pylint: disable=name-too-long + """Properties of subscription permission to create job validation response. + + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.models.CloudError + :ivar status: Validation status of subscription permission to create job. Known values are: + "Valid", "Invalid", and "Skipped". + :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response for validation of subscription permission to create job. + :vartype validation_type: str or + ~azure.mgmt.databox.models.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB + """ + + status: Optional[Union[str, "_models.ValidationStatus"]] = rest_field(visibility=["read"]) + """Validation status of subscription permission to create job. Known values are: \"Valid\", + \"Invalid\", and \"Skipped\".""" + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation response. Required. Identify request and response for + validation of subscription permission to create job.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB # type: ignore + + +class SystemData(_Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.databox.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.databox.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TransferAllDetails(_Model): + """Details to transfer all data. + + :ivar data_account_type: Type of the account of data. Required. Known values are: + "StorageAccount" and "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :ivar transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :vartype transfer_all_blobs: bool + :ivar transfer_all_files: To indicate if all Azure Files have to be transferred. + :vartype transfer_all_files: bool + """ + + data_account_type: Union[str, "_models.DataAccountType"] = rest_field( + name="dataAccountType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the account of data. Required. Known values are: \"StorageAccount\" and + \"ManagedDisk\".""" + transfer_all_blobs: Optional[bool] = rest_field( + name="transferAllBlobs", visibility=["read", "create", "update", "delete", "query"] + ) + """To indicate if all Azure blobs have to be transferred.""" + transfer_all_files: Optional[bool] = rest_field( + name="transferAllFiles", visibility=["read", "create", "update", "delete", "query"] + ) + """To indicate if all Azure Files have to be transferred.""" + + @overload + def __init__( + self, + *, + data_account_type: Union[str, "_models.DataAccountType"], + transfer_all_blobs: Optional[bool] = None, + transfer_all_files: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TransferConfiguration(_Model): + """Configuration for defining the transfer of data. + + :ivar transfer_configuration_type: Type of the configuration for transfer. Required. Known + values are: "TransferAll" and "TransferUsingFilter". + :vartype transfer_configuration_type: str or + ~azure.mgmt.databox.models.TransferConfigurationType + :ivar transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :vartype transfer_filter_details: + ~azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails + :ivar 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. + :vartype transfer_all_details: + ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails + """ + + transfer_configuration_type: Union[str, "_models.TransferConfigurationType"] = rest_field( + name="transferConfigurationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the configuration for transfer. Required. Known values are: \"TransferAll\" and + \"TransferUsingFilter\".""" + transfer_filter_details: Optional["_models.TransferConfigurationTransferFilterDetails"] = rest_field( + name="transferFilterDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Map of filter type and the details to filter. This field is required only if the + TransferConfigurationType is given as TransferUsingFilter.""" + transfer_all_details: Optional["_models.TransferConfigurationTransferAllDetails"] = rest_field( + name="transferAllDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Map of filter type and the details to transfer all data. This field is required only if the + TransferConfigurationType is given as TransferAll.""" + + @overload + def __init__( + self, + *, + transfer_configuration_type: Union[str, "_models.TransferConfigurationType"], + transfer_filter_details: Optional["_models.TransferConfigurationTransferFilterDetails"] = None, + transfer_all_details: Optional["_models.TransferConfigurationTransferAllDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TransferConfigurationTransferAllDetails(_Model): + """Map of filter type and the details to transfer all data. This field is required only if the + TransferConfigurationType is given as TransferAll. + + :ivar include: Details to transfer all data. + :vartype include: ~azure.mgmt.databox.models.TransferAllDetails + """ + + include: Optional["_models.TransferAllDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Details to transfer all data.""" + + @overload + def __init__( + self, + *, + include: Optional["_models.TransferAllDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TransferConfigurationTransferFilterDetails(_Model): # pylint: disable=name-too-long + """Map of filter type and the details to filter. This field is required only if the + TransferConfigurationType is given as TransferUsingFilter. + + :ivar include: Details of the filtering the transfer of data. + :vartype include: ~azure.mgmt.databox.models.TransferFilterDetails + """ + + include: Optional["_models.TransferFilterDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Details of the filtering the transfer of data.""" + + @overload + def __init__( + self, + *, + include: Optional["_models.TransferFilterDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TransferFilterDetails(_Model): + """Details of the filtering the transfer of data. + + :ivar data_account_type: Type of the account of data. Required. Known values are: + "StorageAccount" and "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :ivar blob_filter_details: Filter details to transfer blobs. + :vartype blob_filter_details: ~azure.mgmt.databox.models.BlobFilterDetails + :ivar azure_file_filter_details: Filter details to transfer Azure files. + :vartype azure_file_filter_details: ~azure.mgmt.databox.models.AzureFileFilterDetails + :ivar filter_file_details: Details of the filter files to be used for data transfer. + :vartype filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] + """ + + data_account_type: Union[str, "_models.DataAccountType"] = rest_field( + name="dataAccountType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the account of data. Required. Known values are: \"StorageAccount\" and + \"ManagedDisk\".""" + blob_filter_details: Optional["_models.BlobFilterDetails"] = rest_field( + name="blobFilterDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Filter details to transfer blobs.""" + azure_file_filter_details: Optional["_models.AzureFileFilterDetails"] = rest_field( + name="azureFileFilterDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Filter details to transfer Azure files.""" + filter_file_details: Optional[list["_models.FilterFileDetails"]] = rest_field( + name="filterFileDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Details of the filter files to be used for data transfer.""" + + @overload + def __init__( + self, + *, + data_account_type: Union[str, "_models.DataAccountType"], + blob_filter_details: Optional["_models.BlobFilterDetails"] = None, + azure_file_filter_details: Optional["_models.AzureFileFilterDetails"] = None, + filter_file_details: Optional[list["_models.FilterFileDetails"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TransportAvailabilityDetails(_Model): + """Transport options availability details for given region. + + :ivar shipment_type: Transport Shipment Type supported for given region. Known values are: + "CustomerManaged" and "MicrosoftManaged". + :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + """ + + shipment_type: Optional[Union[str, "_models.TransportShipmentTypes"]] = rest_field( + name="shipmentType", visibility=["read"] + ) + """Transport Shipment Type supported for given region. Known values are: \"CustomerManaged\" and + \"MicrosoftManaged\".""" + + +class TransportAvailabilityRequest(_Model): + """Request body to get the transport availability for given sku. + + :ivar sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", + and "DataBoxCustomerDisk". + :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + """ + + sku_name: Optional[Union[str, "_models.SkuName"]] = rest_field( + name="skuName", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the device. Known values are: \"DataBox\", \"DataBoxDisk\", \"DataBoxHeavy\", and + \"DataBoxCustomerDisk\".""" + model: Optional[Union[str, "_models.ModelName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + + @overload + def __init__( + self, + *, + sku_name: Optional[Union[str, "_models.SkuName"]] = None, + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TransportAvailabilityResponse(_Model): + """Transport options available for given sku in a region. + + :ivar transport_availability_details: List of transport availability details for given region. + :vartype transport_availability_details: + list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + """ + + transport_availability_details: Optional[list["_models.TransportAvailabilityDetails"]] = rest_field( + name="transportAvailabilityDetails", visibility=["read"] + ) + """List of transport availability details for given region.""" + + +class TransportPreferences(_Model): + """Preferences related to the shipment logistics of the sku. + + :ivar preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. + Required. Known values are: "CustomerManaged" and "MicrosoftManaged". + :vartype preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :ivar is_updated: Read only property which indicates whether transport preferences has been + updated or not after device is prepared. + :vartype is_updated: bool + """ + + preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"] = rest_field( + name="preferredShipmentType", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates Shipment Logistics type that the customer preferred. Required. Known values are: + \"CustomerManaged\" and \"MicrosoftManaged\".""" + is_updated: Optional[bool] = rest_field(name="isUpdated", visibility=["read"]) + """Read only property which indicates whether transport preferences has been updated or not after + device is prepared.""" + + @overload + def __init__( + self, + *, + preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UnencryptedCredentials(_Model): + """Unencrypted credentials for accessing device. + + :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 + """ + + job_name: Optional[str] = rest_field(name="jobName", visibility=["read"]) + """Name of the job.""" + job_secrets: Optional["_models.JobSecrets"] = rest_field(name="jobSecrets", visibility=["read"]) + """Secrets related to this job.""" + + +class UpdateJobDetails(_Model): + """Job details for update. + + :ivar contact_details: Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :ivar reverse_shipping_details: Reverse Shipping Address and contact details for a job. + :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails + :ivar preferences: Preferences related to the order. + :vartype preferences: ~azure.mgmt.databox.models.Preferences + :ivar key_encryption_key: Key encryption key for the job. + :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :ivar return_to_customer_package_details: Return package details of job. + :vartype return_to_customer_package_details: ~azure.mgmt.databox.models.PackageCarrierDetails + """ + + contact_details: Optional["_models.ContactDetails"] = rest_field( + name="contactDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Contact details for notification and shipping.""" + shipping_address: Optional["_models.ShippingAddress"] = rest_field( + name="shippingAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Shipping address of the customer.""" + reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = rest_field( + name="reverseShippingDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Reverse Shipping Address and contact details for a job.""" + preferences: Optional["_models.Preferences"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Preferences related to the order.""" + key_encryption_key: Optional["_models.KeyEncryptionKey"] = rest_field( + name="keyEncryptionKey", visibility=["read", "create", "update", "delete", "query"] + ) + """Key encryption key for the job.""" + return_to_customer_package_details: Optional["_models.PackageCarrierDetails"] = rest_field( + name="returnToCustomerPackageDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Return package details of job.""" + + @overload + def __init__( + self, + *, + contact_details: Optional["_models.ContactDetails"] = None, + shipping_address: Optional["_models.ShippingAddress"] = None, + reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, + preferences: Optional["_models.Preferences"] = None, + key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, + return_to_customer_package_details: Optional["_models.PackageCarrierDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateJobProperties(_Model): + """Job Properties for update. + + :ivar details: Details of a job to be updated. + :vartype details: ~azure.mgmt.databox.models.UpdateJobDetails + """ + + details: Optional["_models.UpdateJobDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Details of a job to be updated.""" + + @overload + def __init__( + self, + *, + details: Optional["_models.UpdateJobDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UserAssignedIdentity(_Model): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" + + +class UserAssignedProperties(_Model): + """User assigned identity properties. + + :ivar resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :vartype resource_id: str + """ + + resource_id: Optional[str] = rest_field( + name="resourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Arm resource id for user assigned identity to be used to fetch MSI token.""" + + @overload + def __init__( + self, + *, + resource_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ValidateAddress(ValidationInputRequest, discriminator="ValidateAddress"): + """The requirements to validate customer address where the device needs to be shipped. + + :ivar shipping_address: Shipping address of the customer. Required. + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", + "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype device_type: str or ~azure.mgmt.databox.models.SkuName + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: str or ~azure.mgmt.databox.models.ModelName + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response of address validation. + :vartype validation_type: str or ~azure.mgmt.databox.models.VALIDATE_ADDRESS + """ + + shipping_address: "_models.ShippingAddress" = rest_field( + name="shippingAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Shipping address of the customer. Required.""" + device_type: Union[str, "_models.SkuName"] = rest_field( + name="deviceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Device type to be used for the job. Required. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + transport_preferences: Optional["_models.TransportPreferences"] = rest_field( + name="transportPreferences", visibility=["read", "create", "update", "delete", "query"] + ) + """Preferences related to the shipment logistics of the sku.""" + model: Optional[Union[str, "_models.ModelName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + validation_type: Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS] = rest_discriminator(name="validationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Identifies the type of validation request. Required. Identify request and response of address + validation.""" + + @overload + def __init__( + self, + *, + shipping_address: "_models.ShippingAddress", + device_type: Union[str, "_models.SkuName"], + transport_preferences: Optional["_models.TransportPreferences"] = None, + model: Optional[Union[str, "_models.ModelName"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.validation_type = ValidationInputDiscriminator.VALIDATE_ADDRESS # type: ignore + + +class ValidationResponse(_Model): + """Response of pre job creation validations. + + :ivar properties: Properties of pre job creation validation response. + :vartype properties: ~azure.mgmt.databox.models.ValidationResponseProperties + """ + + properties: Optional["_models.ValidationResponseProperties"] = rest_field(visibility=["read"]) + """Properties of pre job creation validation response.""" + + __flattened_items = ["status", "individual_response_details"] + + +class ValidationResponseProperties(_Model): + """Properties of pre job creation validation response. + + :ivar status: Overall validation status. Known values are: "AllValidToProceed", + "InputsRevisitRequired", and "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. + :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] + """ + + status: Optional[Union[str, "_models.OverallValidationStatus"]] = rest_field(visibility=["read"]) + """Overall validation status. Known values are: \"AllValidToProceed\", \"InputsRevisitRequired\", + and \"CertainInputValidationsSkipped\".""" + individual_response_details: Optional[list["_models.ValidationInputResponse"]] = rest_field( + name="individualResponseDetails", visibility=["read"] + ) + """List of response details contain validationType and its response as key and value respectively.""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_models_py3.py deleted file mode 100644 index 96b7fb3230b8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_models_py3.py +++ /dev/null @@ -1,6669 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -import sys -from typing import Any, Dict, List, Literal, Optional, TYPE_CHECKING, Union - -from .. import _serialization - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore - -if TYPE_CHECKING: - from .. import models as _models -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object - - -class AccountCredentialDetails(_serialization.Model): - """Credential details of the account. - - 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_account_type: Type of the account. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.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. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] - """ - - _validation = { - "account_name": {"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_account_type": {"key": "dataAccountType", "type": "str"}, - "account_connection_string": {"key": "accountConnectionString", "type": "str"}, - "share_credential_details": {"key": "shareCredentialDetails", "type": "[ShareCredentialDetails]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.account_name = None - self.data_account_type = None - self.account_connection_string = None - self.share_credential_details = None - - -class AdditionalErrorInfo(_serialization.Model): - """This class represents additional info which Resource Providers pass when an error occurs. - - :ivar info: Additional information of the type of error. - :vartype info: JSON - :ivar type: Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation). - :vartype type: str - """ - - _attribute_map = { - "info": {"key": "info", "type": "object"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, *, info: Optional[JSON] = None, type: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword info: Additional information of the type of error. - :paramtype info: JSON - :keyword type: Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation). - :paramtype type: str - """ - super().__init__(**kwargs) - self.info = info - self.type = type - - -class AddressValidationOutput(_serialization.Model): - """Output of the address validation api. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar validation_type: Identifies the type of validation response. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] - """ - - _validation = { - "error": {"readonly": True}, - "validation_status": {"readonly": True}, - "alternate_addresses": {"readonly": True}, - } - - _attribute_map = { - "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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: Optional[str] = None - self.error = None - self.validation_status = None - self.alternate_addresses = None - - -class ValidationInputResponse(_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 server. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: Optional[str] = None - 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 server. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.validation_status = None - self.alternate_addresses = None - - -class ApiError(_serialization.Model): - """ApiError. - - All required parameters must be populated in order to send to server. - - :ivar error: Required. - :vartype error: ~azure.mgmt.databox.models.ErrorDetail - """ - - _validation = { - "error": {"required": True}, - } - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__(self, *, error: "_models.ErrorDetail", **kwargs: Any) -> None: - """ - :keyword error: Required. - :paramtype error: ~azure.mgmt.databox.models.ErrorDetail - """ - super().__init__(**kwargs) - self.error = error - - -class ApplianceNetworkConfiguration(_serialization.Model): - """The Network Adapter configuration of a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the network. - :vartype name: str - :ivar mac_address: Mac Address. - :vartype mac_address: str - """ - - _validation = { - "name": {"readonly": True}, - "mac_address": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "mac_address": {"key": "macAddress", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.mac_address = None - - -class ArmBaseObject(_serialization.Model): - """Base class for all objects under resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - """ - - _validation = { - "name": {"readonly": True}, - "id": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.id = None - self.type = None - - -class AvailableSkuRequest(_serialization.Model): - """The filters for showing the available skus. - - All required parameters must be populated in order to send to server. - - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar country: ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. Required. - :vartype country: str - :ivar location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :vartype location: str - :ivar sku_names: Sku Names to filter for available skus. - :vartype sku_names: list[str or ~azure.mgmt.databox.models.SkuName] - """ - - _validation = { - "transfer_type": {"required": True}, - "country": {"required": True}, - "location": {"required": True}, - } - - _attribute_map = { - "transfer_type": {"key": "transferType", "type": "str"}, - "country": {"key": "country", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "sku_names": {"key": "skuNames", "type": "[str]"}, - } - - def __init__( - self, - *, - transfer_type: Union[str, "_models.TransferType"], - country: str, - location: str, - sku_names: Optional[List[Union[str, "_models.SkuName"]]] = None, - **kwargs: Any - ) -> None: - """ - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :keyword country: ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. Required. - :paramtype country: str - :keyword location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :paramtype location: str - :keyword sku_names: Sku Names to filter for available skus. - :paramtype sku_names: list[str or ~azure.mgmt.databox.models.SkuName] - """ - super().__init__(**kwargs) - self.transfer_type = transfer_type - self.country = country - self.location = location - self.sku_names = sku_names - - -class AvailableSkusResult(_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[~azure.mgmt.databox.models.SkuInformation] - :ivar next_link: Link for the next set of skus. - :vartype 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: Any) -> None: - """ - :keyword next_link: Link for the next set of skus. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class AzureFileFilterDetails(_serialization.Model): - """Filter details to transfer Azure files. - - :ivar file_prefix_list: Prefix list of the Azure files to be transferred. - :vartype file_prefix_list: list[str] - :ivar file_path_list: List of full path of the files to be transferred. - :vartype file_path_list: list[str] - :ivar file_share_list: List of file shares to be transferred. - :vartype 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: Any - ) -> None: - """ - :keyword file_prefix_list: Prefix list of the Azure files to be transferred. - :paramtype file_prefix_list: list[str] - :keyword file_path_list: List of full path of the files to be transferred. - :paramtype file_path_list: list[str] - :keyword file_share_list: List of file shares to be transferred. - :paramtype file_share_list: list[str] - """ - super().__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(_serialization.Model): - """Filter details to transfer Azure Blobs. - - :ivar blob_prefix_list: Prefix list of the Azure blobs to be transferred. - :vartype blob_prefix_list: list[str] - :ivar blob_path_list: List of full path of the blobs to be transferred. - :vartype blob_path_list: list[str] - :ivar container_list: List of blob containers to be transferred. - :vartype 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: Any - ) -> None: - """ - :keyword blob_prefix_list: Prefix list of the Azure blobs to be transferred. - :paramtype blob_prefix_list: list[str] - :keyword blob_path_list: List of full path of the blobs to be transferred. - :paramtype blob_path_list: list[str] - :keyword container_list: List of blob containers to be transferred. - :paramtype container_list: list[str] - """ - super().__init__(**kwargs) - self.blob_prefix_list = blob_prefix_list - self.blob_path_list = blob_path_list - self.container_list = container_list - - -class CancellationReason(_serialization.Model): - """Reason for cancellation. - - All required parameters must be populated in order to send to server. - - :ivar reason: Reason for cancellation. Required. - :vartype reason: str - """ - - _validation = { - "reason": {"required": True}, - } - - _attribute_map = { - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: str, **kwargs: Any) -> None: - """ - :keyword reason: Reason for cancellation. Required. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.reason = reason - - -class CloudError(_serialization.Model): - """Provides additional information about an http error response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar additional_info: Gets or sets additional error info. - :vartype additional_info: list[~azure.mgmt.databox.models.AdditionalErrorInfo] - :ivar code: Error code. - :vartype code: str - :ivar details: Gets or sets details for the error. - :vartype details: list[~azure.mgmt.databox.models.CloudError] - :ivar message: The error message parsed from the body of the http error response. - :vartype message: str - :ivar target: Gets or sets the target of the error. - :vartype target: str - """ - - _validation = { - "additional_info": {"readonly": True}, - "details": {"readonly": True}, - } - - _attribute_map = { - "additional_info": {"key": "additionalInfo", "type": "[AdditionalErrorInfo]"}, - "code": {"key": "code", "type": "str"}, - "details": {"key": "details", "type": "[CloudError]"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - } - - def __init__( - self, *, code: Optional[str] = None, message: Optional[str] = None, target: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword code: Error code. - :paramtype code: str - :keyword message: The error message parsed from the body of the http error response. - :paramtype message: str - :keyword target: Gets or sets the target of the error. - :paramtype target: str - """ - super().__init__(**kwargs) - self.additional_info = None - self.code = code - self.details = None - self.message = message - self.target = target - - -class ContactDetails(_serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to server. - - :ivar contact_name: Contact name of the person. Required. - :vartype contact_name: str - :ivar phone: Phone number of the contact person. Required. - :vartype phone: str - :ivar phone_extension: Phone extension number of the contact person. - :vartype phone_extension: str - :ivar mobile: Mobile number of the contact person. - :vartype mobile: str - :ivar email_list: List of Email-ids to be notified about job progress. Required. - :vartype email_list: list[str] - :ivar notification_preference: Notification preference for a job stage. - :vartype notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] - """ - - _validation = { - "contact_name": {"required": True}, - "phone": {"required": True}, - "email_list": {"required": True}, - } - - _attribute_map = { - "contact_name": {"key": "contactName", "type": "str"}, - "phone": {"key": "phone", "type": "str"}, - "phone_extension": {"key": "phoneExtension", "type": "str"}, - "mobile": {"key": "mobile", "type": "str"}, - "email_list": {"key": "emailList", "type": "[str]"}, - "notification_preference": {"key": "notificationPreference", "type": "[NotificationPreference]"}, - } - - 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["_models.NotificationPreference"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_name: Contact name of the person. Required. - :paramtype contact_name: str - :keyword phone: Phone number of the contact person. Required. - :paramtype phone: str - :keyword phone_extension: Phone extension number of the contact person. - :paramtype phone_extension: str - :keyword mobile: Mobile number of the contact person. - :paramtype mobile: str - :keyword email_list: List of Email-ids to be notified about job progress. Required. - :paramtype email_list: list[str] - :keyword notification_preference: Notification preference for a job stage. - :paramtype notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] - """ - super().__init__(**kwargs) - 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 - - -class ContactInfo(_serialization.Model): - """Contact Info. - - All required parameters must be populated in order to send to server. - - :ivar contact_name: Contact name of the person. Required. - :vartype contact_name: str - :ivar phone: Phone number of the contact person. Required. - :vartype phone: str - :ivar phone_extension: Phone extension number of the contact person. - :vartype phone_extension: str - :ivar mobile: Mobile number of the contact person. - :vartype mobile: str - """ - - _validation = { - "contact_name": {"required": True, "min_length": 1}, - "phone": {"required": True, "min_length": 1}, - } - - _attribute_map = { - "contact_name": {"key": "contactName", "type": "str"}, - "phone": {"key": "phone", "type": "str"}, - "phone_extension": {"key": "phoneExtension", "type": "str"}, - "mobile": {"key": "mobile", "type": "str"}, - } - - def __init__( - self, - *, - contact_name: str, - phone: str, - phone_extension: Optional[str] = None, - mobile: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_name: Contact name of the person. Required. - :paramtype contact_name: str - :keyword phone: Phone number of the contact person. Required. - :paramtype phone: str - :keyword phone_extension: Phone extension number of the contact person. - :paramtype phone_extension: str - :keyword mobile: Mobile number of the contact person. - :paramtype mobile: str - """ - super().__init__(**kwargs) - self.contact_name = contact_name - self.phone = phone - self.phone_extension = phone_extension - self.mobile = mobile - - -class CopyLogDetails(_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, DataBoxCustomerDiskCopyLogDetails, DataBoxDiskCopyLogDetails, - DataBoxHeavyAccountCopyLogDetails - - All required parameters must be populated in order to send to server. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - """ - - _validation = { - "copy_log_details_type": {"required": True}, - } - - _attribute_map = { - "copy_log_details_type": {"key": "copyLogDetailsType", "type": "str"}, - } - - _subtype_map = { - "copy_log_details_type": { - "DataBox": "DataBoxAccountCopyLogDetails", - "DataBoxCustomerDisk": "DataBoxCustomerDiskCopyLogDetails", - "DataBoxDisk": "DataBoxDiskCopyLogDetails", - "DataBoxHeavy": "DataBoxHeavyAccountCopyLogDetails", - } - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.copy_log_details_type: Optional[str] = None - - -class CopyProgress(_serialization.Model): - """Copy progress. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar account_id: Id of the account where the data needs to be uploaded. - :vartype account_id: str - :ivar bytes_processed: To indicate bytes transferred. - :vartype bytes_processed: int - :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: int - :ivar files_processed: Number of files processed. - :vartype files_processed: int - :ivar total_files_to_process: Total files to process. - :vartype total_files_to_process: int - :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype invalid_files_processed: int - :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: int - :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype renamed_container_count: int - :ivar files_errored_out: Number of files which could not be copied. - :vartype files_errored_out: int - :ivar directories_errored_out: To indicate directories errored out in the job. - :vartype directories_errored_out: int - :ivar invalid_directories_processed: To indicate directories renamed. - :vartype invalid_directories_processed: int - :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 - :ivar error: Error, if any, in the stage. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] - """ - - _validation = { - "storage_account_name": {"readonly": True}, - "transfer_type": {"readonly": True}, - "data_account_type": {"readonly": True}, - "account_id": {"readonly": True}, - "bytes_processed": {"readonly": True}, - "total_bytes_to_process": {"readonly": True}, - "files_processed": {"readonly": True}, - "total_files_to_process": {"readonly": True}, - "invalid_files_processed": {"readonly": True}, - "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}, - "error": {"readonly": True}, - "actions": {"readonly": True}, - } - - _attribute_map = { - "storage_account_name": {"key": "storageAccountName", "type": "str"}, - "transfer_type": {"key": "transferType", "type": "str"}, - "data_account_type": {"key": "dataAccountType", "type": "str"}, - "account_id": {"key": "accountId", "type": "str"}, - "bytes_processed": {"key": "bytesProcessed", "type": "int"}, - "total_bytes_to_process": {"key": "totalBytesToProcess", "type": "int"}, - "files_processed": {"key": "filesProcessed", "type": "int"}, - "total_files_to_process": {"key": "totalFilesToProcess", "type": "int"}, - "invalid_files_processed": {"key": "invalidFilesProcessed", "type": "int"}, - "invalid_file_bytes_uploaded": {"key": "invalidFileBytesUploaded", "type": "int"}, - "renamed_container_count": {"key": "renamedContainerCount", "type": "int"}, - "files_errored_out": {"key": "filesErroredOut", "type": "int"}, - "directories_errored_out": {"key": "directoriesErroredOut", "type": "int"}, - "invalid_directories_processed": {"key": "invalidDirectoriesProcessed", "type": "int"}, - "is_enumeration_in_progress": {"key": "isEnumerationInProgress", "type": "bool"}, - "error": {"key": "error", "type": "CloudError"}, - "actions": {"key": "actions", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.storage_account_name = None - self.transfer_type = None - self.data_account_type = None - self.account_id = None - self.bytes_processed = None - self.total_bytes_to_process = None - self.files_processed = None - self.total_files_to_process = None - self.invalid_files_processed = 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 - self.error = None - self.actions = None - - -class ValidationRequest(_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 - - All required parameters must be populated in order to send to server. - - :ivar validation_category: Identify the nature of validation. Required. Default value is - "JobCreationValidation". - :vartype validation_category: str - :ivar individual_request_details: List of request details contain validationType and its - request as key and value respectively. Required. - :vartype individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - """ - - _validation = { - "validation_category": {"required": True}, - "individual_request_details": {"required": True}, - } - - _attribute_map = { - "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: List["_models.ValidationInputRequest"], **kwargs: Any) -> None: - """ - :keyword individual_request_details: List of request details contain validationType and its - request as key and value respectively. Required. - :paramtype individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - """ - super().__init__(**kwargs) - self.validation_category: Optional[str] = None - self.individual_request_details = individual_request_details - - -class CreateJobValidations(ValidationRequest): - """It does all pre-job creation validations. - - All required parameters must be populated in order to send to server. - - :ivar validation_category: Identify the nature of validation. Required. Default value is - "JobCreationValidation". - :vartype validation_category: str - :ivar individual_request_details: List of request details contain validationType and its - request as key and value respectively. Required. - :vartype individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - """ - - _validation = { - "validation_category": {"required": True}, - "individual_request_details": {"required": True}, - } - - _attribute_map = { - "validation_category": {"key": "validationCategory", "type": "str"}, - "individual_request_details": {"key": "individualRequestDetails", "type": "[ValidationInputRequest]"}, - } - - def __init__(self, *, individual_request_details: List["_models.ValidationInputRequest"], **kwargs: Any) -> None: - """ - :keyword individual_request_details: List of request details contain validationType and its - request as key and value respectively. Required. - :paramtype individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - """ - super().__init__(individual_request_details=individual_request_details, **kwargs) - self.validation_category: str = "JobCreationValidation" - - -class ValidationInputRequest(_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: - ValidateAddress, CreateOrderLimitForSubscriptionValidationRequest, - DataTransferDetailsValidationRequest, PreferencesValidationRequest, - SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest - - All required parameters must be populated in order to send to server. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - """ - - _validation = { - "validation_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - } - - _subtype_map = { - "validation_type": { - "ValidateAddress": "ValidateAddress", - "ValidateCreateOrderLimit": "CreateOrderLimitForSubscriptionValidationRequest", - "ValidateDataTransferDetails": "DataTransferDetailsValidationRequest", - "ValidatePreferences": "PreferencesValidationRequest", - "ValidateSkuAvailability": "SkuAvailabilityValidationRequest", - "ValidateSubscriptionIsAllowedToCreateJob": "SubscriptionIsAllowedToCreateJobValidationRequest", - } - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: Optional[str] = None - - -class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): # pylint: disable=name-too-long - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to server. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - "model": {"key": "model", "type": "str"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype device_type: str or ~azure.mgmt.databox.models.SkuName - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.device_type = device_type - self.model = model - - -class CreateOrderLimitForSubscriptionValidationResponseProperties( - ValidationInputResponse -): # pylint: disable=name-too-long - """Properties of create order limit for subscription validation response. - - 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 server. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - "validation_type": {"required": True}, - "error": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "error": {"key": "error", "type": "CloudError"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.status = None - - -class JobSecrets(_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: - DataboxJobSecrets, CustomerDiskJobSecrets, 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 server. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - """ - - _validation = { - "job_secrets_type": {"required": True}, - "dc_access_security_code": {"readonly": True}, - "error": {"readonly": True}, - } - - _attribute_map = { - "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": { - "DataBox": "DataboxJobSecrets", - "DataBoxCustomerDisk": "CustomerDiskJobSecrets", - "DataBoxDisk": "DataBoxDiskJobSecrets", - "DataBoxHeavy": "DataBoxHeavyJobSecrets", - } - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.job_secrets_type: Optional[str] = None - self.dc_access_security_code = None - self.error = None - - -class CustomerDiskJobSecrets(JobSecrets): - """The secrets related to customer disk 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 server. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] - :ivar carrier_account_number: Carrier Account Number of the customer. - :vartype carrier_account_number: str - """ - - _validation = { - "job_secrets_type": {"required": True}, - "dc_access_security_code": {"readonly": True}, - "error": {"readonly": True}, - "disk_secrets": {"readonly": True}, - "carrier_account_number": {"readonly": True}, - } - - _attribute_map = { - "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]"}, - "carrier_account_number": {"key": "carrierAccountNumber", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.job_secrets_type: str = "DataBoxCustomerDisk" - self.disk_secrets = None - self.carrier_account_number = None - - -class DataAccountDetails(_serialization.Model): - """Account details of the data to be transferred. - - 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 server. - - :ivar data_account_type: Account Type of the data to be transferred. Required. Known values - are: "StorageAccount" and "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar 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 : @#-$%^!+=;:_()]+. - :vartype share_password: str - """ - - _validation = { - "data_account_type": {"required": True}, - } - - _attribute_map = { - "data_account_type": {"key": "dataAccountType", "type": "str"}, - "share_password": {"key": "sharePassword", "type": "str"}, - } - - _subtype_map = { - "data_account_type": {"ManagedDisk": "ManagedDiskDetails", "StorageAccount": "StorageAccountDetails"} - } - - def __init__(self, *, share_password: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword 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 : @#-$%^!+=;:_()]+. - :paramtype share_password: str - """ - super().__init__(**kwargs) - self.data_account_type: Optional[str] = None - 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. - - All required parameters must be populated in order to send to server. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.copy_log_details_type: str = "DataBox" - self.account_name = None - self.copy_log_link = None - self.copy_verbose_log_link = None - - -class DataBoxCustomerDiskCopyLogDetails(CopyLogDetails): - """Copy Log Details for customer disk. - - 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 server. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar serial_number: Disk Serial Number. - :vartype serial_number: str - :ivar error_log_link: Link for copy error logs. - :vartype error_log_link: str - :ivar verbose_log_link: Link for copy verbose logs. - :vartype verbose_log_link: str - """ - - _validation = { - "copy_log_details_type": {"required": True}, - "serial_number": {"readonly": True}, - "error_log_link": {"readonly": True}, - "verbose_log_link": {"readonly": True}, - } - - _attribute_map = { - "copy_log_details_type": {"key": "copyLogDetailsType", "type": "str"}, - "serial_number": {"key": "serialNumber", "type": "str"}, - "error_log_link": {"key": "errorLogLink", "type": "str"}, - "verbose_log_link": {"key": "verboseLogLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.copy_log_details_type: str = "DataBoxCustomerDisk" - self.serial_number = None - self.error_log_link = None - self.verbose_log_link = None - - -class DataBoxCustomerDiskCopyProgress(CopyProgress): - """DataBox CustomerDisk Copy Progress. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar account_id: Id of the account where the data needs to be uploaded. - :vartype account_id: str - :ivar bytes_processed: To indicate bytes transferred. - :vartype bytes_processed: int - :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: int - :ivar files_processed: Number of files processed. - :vartype files_processed: int - :ivar total_files_to_process: Total files to process. - :vartype total_files_to_process: int - :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype invalid_files_processed: int - :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: int - :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype renamed_container_count: int - :ivar files_errored_out: Number of files which could not be copied. - :vartype files_errored_out: int - :ivar directories_errored_out: To indicate directories errored out in the job. - :vartype directories_errored_out: int - :ivar invalid_directories_processed: To indicate directories renamed. - :vartype invalid_directories_processed: int - :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 - :ivar error: Error, if any, in the stage. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] - :ivar serial_number: Disk Serial Number. - :vartype serial_number: str - :ivar copy_status: The Status of the copy. Known values are: "NotStarted", "InProgress", - "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", - "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", - "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", - "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". - :vartype copy_status: str or ~azure.mgmt.databox.models.CopyStatus - """ - - _validation = { - "storage_account_name": {"readonly": True}, - "transfer_type": {"readonly": True}, - "data_account_type": {"readonly": True}, - "account_id": {"readonly": True}, - "bytes_processed": {"readonly": True}, - "total_bytes_to_process": {"readonly": True}, - "files_processed": {"readonly": True}, - "total_files_to_process": {"readonly": True}, - "invalid_files_processed": {"readonly": True}, - "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}, - "error": {"readonly": True}, - "actions": {"readonly": True}, - "serial_number": {"readonly": True}, - "copy_status": {"readonly": True}, - } - - _attribute_map = { - "storage_account_name": {"key": "storageAccountName", "type": "str"}, - "transfer_type": {"key": "transferType", "type": "str"}, - "data_account_type": {"key": "dataAccountType", "type": "str"}, - "account_id": {"key": "accountId", "type": "str"}, - "bytes_processed": {"key": "bytesProcessed", "type": "int"}, - "total_bytes_to_process": {"key": "totalBytesToProcess", "type": "int"}, - "files_processed": {"key": "filesProcessed", "type": "int"}, - "total_files_to_process": {"key": "totalFilesToProcess", "type": "int"}, - "invalid_files_processed": {"key": "invalidFilesProcessed", "type": "int"}, - "invalid_file_bytes_uploaded": {"key": "invalidFileBytesUploaded", "type": "int"}, - "renamed_container_count": {"key": "renamedContainerCount", "type": "int"}, - "files_errored_out": {"key": "filesErroredOut", "type": "int"}, - "directories_errored_out": {"key": "directoriesErroredOut", "type": "int"}, - "invalid_directories_processed": {"key": "invalidDirectoriesProcessed", "type": "int"}, - "is_enumeration_in_progress": {"key": "isEnumerationInProgress", "type": "bool"}, - "error": {"key": "error", "type": "CloudError"}, - "actions": {"key": "actions", "type": "[str]"}, - "serial_number": {"key": "serialNumber", "type": "str"}, - "copy_status": {"key": "copyStatus", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.copy_status = None - - -class JobDetails(_serialization.Model): - """Job details. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DataBoxJobDetails, DataBoxCustomerDiskJobDetails, DataBoxDiskJobDetails, DataBoxHeavyJobDetails - - 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 server. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :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 reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - :ivar device_erasure_details: Holds device data erasure details. - :vartype device_erasure_details: ~azure.mgmt.databox.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :vartype expected_data_size_in_tera_bytes: int - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: ~azure.mgmt.databox.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.models.DatacenterAddressResponse - :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", - "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", - "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", - "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", - "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", - "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", - "BJS20", "BL24", "IDC5", "TYO23", "CPQ21", "NTG20", "DXB23", "DSM11", "OSA23", and "AMS25". - :vartype data_center_code: str or ~azure.mgmt.databox.models.DataCenterCode - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"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}, - "device_erasure_details": {"readonly": True}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"readonly": True}, - "datacenter_address": {"readonly": True}, - "data_center_code": {"readonly": True}, - } - - _attribute_map = { - "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"}, - "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"}, - "reverse_shipping_details": {"key": "reverseShippingDetails", "type": "ReverseShippingDetails"}, - "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"}, - "device_erasure_details": {"key": "deviceErasureDetails", "type": "DeviceErasureDetails"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "actions": {"key": "actions", "type": "[str]"}, - "last_mitigation_action_on_job": {"key": "lastMitigationActionOnJob", "type": "LastMitigationActionOnJob"}, - "datacenter_address": {"key": "datacenterAddress", "type": "DatacenterAddressResponse"}, - "data_center_code": {"key": "dataCenterCode", "type": "str"}, - } - - _subtype_map = { - "job_details_type": { - "DataBox": "DataBoxJobDetails", - "DataBoxCustomerDisk": "DataBoxCustomerDiskJobDetails", - "DataBoxDisk": "DataBoxDiskJobDetails", - "DataBoxHeavy": "DataBoxHeavyJobDetails", - } - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: Optional["_models.ShippingAddress"] = None, - data_import_details: Optional[List["_models.DataImportDetails"]] = None, - data_export_details: Optional[List["_models.DataExportDetails"]] = None, - preferences: Optional["_models.Preferences"] = None, - reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, - key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, - expected_data_size_in_tera_bytes: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :paramtype expected_data_size_in_tera_bytes: int - """ - super().__init__(**kwargs) - self.job_stages = None - self.contact_details = contact_details - self.shipping_address = shipping_address - self.delivery_package = None - self.return_package = None - self.data_import_details = data_import_details - self.data_export_details = data_export_details - self.job_details_type: Optional[str] = None - self.preferences = preferences - self.reverse_shipping_details = reverse_shipping_details - self.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = None - self.device_erasure_details = None - self.key_encryption_key = key_encryption_key - self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes - self.actions = None - self.last_mitigation_action_on_job = None - self.datacenter_address = None - self.data_center_code = None - - -class DataBoxCustomerDiskJobDetails(JobDetails): - """Customer disk job 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 server. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :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 reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - :ivar device_erasure_details: Holds device data erasure details. - :vartype device_erasure_details: ~azure.mgmt.databox.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :vartype expected_data_size_in_tera_bytes: int - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: ~azure.mgmt.databox.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.models.DatacenterAddressResponse - :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", - "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", - "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", - "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", - "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", - "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", - "BJS20", "BL24", "IDC5", "TYO23", "CPQ21", "NTG20", "DXB23", "DSM11", "OSA23", and "AMS25". - :vartype data_center_code: str or ~azure.mgmt.databox.models.DataCenterCode - :ivar import_disk_details_collection: Contains the map of disk serial number to the disk - details for import jobs. - :vartype import_disk_details_collection: dict[str, - ~azure.mgmt.databox.models.ImportDiskDetails] - :ivar export_disk_details_collection: Contains the map of disk serial number to the disk - details for export jobs. - :vartype export_disk_details_collection: dict[str, - ~azure.mgmt.databox.models.ExportDiskDetails] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxCustomerDiskCopyProgress] - :ivar deliver_to_dc_package_details: Delivery package shipping details. - :vartype deliver_to_dc_package_details: ~azure.mgmt.databox.models.PackageCarrierInfo - :ivar return_to_customer_package_details: Return package shipping details. Required. - :vartype return_to_customer_package_details: ~azure.mgmt.databox.models.PackageCarrierDetails - :ivar enable_manifest_backup: Flag to indicate if disk manifest should be backed-up in the - Storage Account. - :vartype enable_manifest_backup: bool - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"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}, - "device_erasure_details": {"readonly": True}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"readonly": True}, - "datacenter_address": {"readonly": True}, - "data_center_code": {"readonly": True}, - "export_disk_details_collection": {"readonly": True}, - "copy_progress": {"readonly": True}, - "deliver_to_dc_package_details": {"readonly": True}, - "return_to_customer_package_details": {"required": True}, - } - - _attribute_map = { - "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"}, - "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"}, - "reverse_shipping_details": {"key": "reverseShippingDetails", "type": "ReverseShippingDetails"}, - "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"}, - "device_erasure_details": {"key": "deviceErasureDetails", "type": "DeviceErasureDetails"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "actions": {"key": "actions", "type": "[str]"}, - "last_mitigation_action_on_job": {"key": "lastMitigationActionOnJob", "type": "LastMitigationActionOnJob"}, - "datacenter_address": {"key": "datacenterAddress", "type": "DatacenterAddressResponse"}, - "data_center_code": {"key": "dataCenterCode", "type": "str"}, - "import_disk_details_collection": {"key": "importDiskDetailsCollection", "type": "{ImportDiskDetails}"}, - "export_disk_details_collection": {"key": "exportDiskDetailsCollection", "type": "{ExportDiskDetails}"}, - "copy_progress": {"key": "copyProgress", "type": "[DataBoxCustomerDiskCopyProgress]"}, - "deliver_to_dc_package_details": {"key": "deliverToDcPackageDetails", "type": "PackageCarrierInfo"}, - "return_to_customer_package_details": { - "key": "returnToCustomerPackageDetails", - "type": "PackageCarrierDetails", - }, - "enable_manifest_backup": {"key": "enableManifestBackup", "type": "bool"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - contact_details: "_models.ContactDetails", - return_to_customer_package_details: "_models.PackageCarrierDetails", - shipping_address: Optional["_models.ShippingAddress"] = None, - data_import_details: Optional[List["_models.DataImportDetails"]] = None, - data_export_details: Optional[List["_models.DataExportDetails"]] = None, - preferences: Optional["_models.Preferences"] = None, - reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, - key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, - expected_data_size_in_tera_bytes: Optional[int] = None, - import_disk_details_collection: Optional[Dict[str, "_models.ImportDiskDetails"]] = None, - enable_manifest_backup: bool = False, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :paramtype expected_data_size_in_tera_bytes: int - :keyword import_disk_details_collection: Contains the map of disk serial number to the disk - details for import jobs. - :paramtype import_disk_details_collection: dict[str, - ~azure.mgmt.databox.models.ImportDiskDetails] - :keyword return_to_customer_package_details: Return package shipping details. Required. - :paramtype return_to_customer_package_details: ~azure.mgmt.databox.models.PackageCarrierDetails - :keyword enable_manifest_backup: Flag to indicate if disk manifest should be backed-up in the - Storage Account. - :paramtype enable_manifest_backup: bool - """ - super().__init__( - contact_details=contact_details, - shipping_address=shipping_address, - data_import_details=data_import_details, - data_export_details=data_export_details, - preferences=preferences, - reverse_shipping_details=reverse_shipping_details, - key_encryption_key=key_encryption_key, - expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, - **kwargs - ) - self.job_details_type: str = "DataBoxCustomerDisk" - self.import_disk_details_collection = import_disk_details_collection - self.export_disk_details_collection = None - self.copy_progress = None - self.deliver_to_dc_package_details = None - self.return_to_customer_package_details = return_to_customer_package_details - self.enable_manifest_backup = enable_manifest_backup - - -class DataBoxDiskCopyLogDetails(CopyLogDetails): - """Copy Log Details for a disk. - - 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 server. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar disk_serial_number: Disk Serial Number. - :vartype disk_serial_number: str - :ivar error_log_link: Link for copy error logs. - :vartype error_log_link: str - :ivar verbose_log_link: Link for copy verbose logs. - :vartype verbose_log_link: str - """ - - _validation = { - "copy_log_details_type": {"required": True}, - "disk_serial_number": {"readonly": True}, - "error_log_link": {"readonly": True}, - "verbose_log_link": {"readonly": True}, - } - - _attribute_map = { - "copy_log_details_type": {"key": "copyLogDetailsType", "type": "str"}, - "disk_serial_number": {"key": "diskSerialNumber", "type": "str"}, - "error_log_link": {"key": "errorLogLink", "type": "str"}, - "verbose_log_link": {"key": "verboseLogLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.copy_log_details_type: str = "DataBoxDisk" - self.disk_serial_number = None - self.error_log_link = None - self.verbose_log_link = None - - -class DataBoxDiskCopyProgress(_serialization.Model): - """DataBox Disk Copy Progress. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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: int - :ivar percent_complete: Indicates the percentage completed for the copy of the disk. - :vartype percent_complete: int - :ivar status: The Status of the copy. Known values are: "NotStarted", "InProgress", - "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", - "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", - "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", - "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus - :ivar error: Error, if any, in the stage. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] - """ - - _validation = { - "serial_number": {"readonly": True}, - "bytes_copied": {"readonly": True}, - "percent_complete": {"readonly": True}, - "status": {"readonly": True}, - "error": {"readonly": True}, - "actions": {"readonly": True}, - } - - _attribute_map = { - "serial_number": {"key": "serialNumber", "type": "str"}, - "bytes_copied": {"key": "bytesCopied", "type": "int"}, - "percent_complete": {"key": "percentComplete", "type": "int"}, - "status": {"key": "status", "type": "str"}, - "error": {"key": "error", "type": "CloudError"}, - "actions": {"key": "actions", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - self.error = None - self.actions = None - - -class GranularCopyLogDetails(_serialization.Model): - """Granular Details for log generated during copy. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DataBoxDiskGranularCopyLogDetails - - All required parameters must be populated in order to send to server. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - """ - - _validation = { - "copy_log_details_type": {"required": True}, - } - - _attribute_map = { - "copy_log_details_type": {"key": "copyLogDetailsType", "type": "str"}, - } - - _subtype_map = {"copy_log_details_type": {"DataBoxCustomerDisk": "DataBoxDiskGranularCopyLogDetails"}} - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.copy_log_details_type: Optional[str] = None - - -class DataBoxDiskGranularCopyLogDetails(GranularCopyLogDetails): - """Granular Copy Log Details for customer disk. - - 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 server. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar serial_number: Disk Serial Number. - :vartype serial_number: str - :ivar account_id: Account id. - :vartype account_id: str - :ivar error_log_link: Link for copy error logs. - :vartype error_log_link: str - :ivar verbose_log_link: Link for copy verbose logs. - :vartype verbose_log_link: str - """ - - _validation = { - "copy_log_details_type": {"required": True}, - "serial_number": {"readonly": True}, - "account_id": {"readonly": True}, - "error_log_link": {"readonly": True}, - "verbose_log_link": {"readonly": True}, - } - - _attribute_map = { - "copy_log_details_type": {"key": "copyLogDetailsType", "type": "str"}, - "serial_number": {"key": "serialNumber", "type": "str"}, - "account_id": {"key": "accountId", "type": "str"}, - "error_log_link": {"key": "errorLogLink", "type": "str"}, - "verbose_log_link": {"key": "verboseLogLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.copy_log_details_type: str = "DataBoxCustomerDisk" - self.serial_number = None - self.account_id = None - self.error_log_link = None - self.verbose_log_link = None - - -class GranularCopyProgress(_serialization.Model): - """Granular Copy progress. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar account_id: Id of the account where the data needs to be uploaded. - :vartype account_id: str - :ivar bytes_processed: To indicate bytes transferred. - :vartype bytes_processed: int - :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: int - :ivar files_processed: Number of files processed. - :vartype files_processed: int - :ivar total_files_to_process: Total files to process. - :vartype total_files_to_process: int - :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype invalid_files_processed: int - :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: int - :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype renamed_container_count: int - :ivar files_errored_out: Number of files which could not be copied. - :vartype files_errored_out: int - :ivar directories_errored_out: To indicate directories errored out in the job. - :vartype directories_errored_out: int - :ivar invalid_directories_processed: To indicate directories renamed. - :vartype invalid_directories_processed: int - :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 - :ivar error: Error, if any, in the stage. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] - """ - - _validation = { - "storage_account_name": {"readonly": True}, - "transfer_type": {"readonly": True}, - "data_account_type": {"readonly": True}, - "account_id": {"readonly": True}, - "bytes_processed": {"readonly": True}, - "total_bytes_to_process": {"readonly": True}, - "files_processed": {"readonly": True}, - "total_files_to_process": {"readonly": True}, - "invalid_files_processed": {"readonly": True}, - "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}, - "error": {"readonly": True}, - "actions": {"readonly": True}, - } - - _attribute_map = { - "storage_account_name": {"key": "storageAccountName", "type": "str"}, - "transfer_type": {"key": "transferType", "type": "str"}, - "data_account_type": {"key": "dataAccountType", "type": "str"}, - "account_id": {"key": "accountId", "type": "str"}, - "bytes_processed": {"key": "bytesProcessed", "type": "int"}, - "total_bytes_to_process": {"key": "totalBytesToProcess", "type": "int"}, - "files_processed": {"key": "filesProcessed", "type": "int"}, - "total_files_to_process": {"key": "totalFilesToProcess", "type": "int"}, - "invalid_files_processed": {"key": "invalidFilesProcessed", "type": "int"}, - "invalid_file_bytes_uploaded": {"key": "invalidFileBytesUploaded", "type": "int"}, - "renamed_container_count": {"key": "renamedContainerCount", "type": "int"}, - "files_errored_out": {"key": "filesErroredOut", "type": "int"}, - "directories_errored_out": {"key": "directoriesErroredOut", "type": "int"}, - "invalid_directories_processed": {"key": "invalidDirectoriesProcessed", "type": "int"}, - "is_enumeration_in_progress": {"key": "isEnumerationInProgress", "type": "bool"}, - "error": {"key": "error", "type": "CloudError"}, - "actions": {"key": "actions", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.storage_account_name = None - self.transfer_type = None - self.data_account_type = None - self.account_id = None - self.bytes_processed = None - self.total_bytes_to_process = None - self.files_processed = None - self.total_files_to_process = None - self.invalid_files_processed = 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 - self.error = None - self.actions = None - - -class DataBoxDiskGranularCopyProgress(GranularCopyProgress): - """DataBox Disk Granular Copy Progress. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar account_id: Id of the account where the data needs to be uploaded. - :vartype account_id: str - :ivar bytes_processed: To indicate bytes transferred. - :vartype bytes_processed: int - :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: int - :ivar files_processed: Number of files processed. - :vartype files_processed: int - :ivar total_files_to_process: Total files to process. - :vartype total_files_to_process: int - :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype invalid_files_processed: int - :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: int - :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype renamed_container_count: int - :ivar files_errored_out: Number of files which could not be copied. - :vartype files_errored_out: int - :ivar directories_errored_out: To indicate directories errored out in the job. - :vartype directories_errored_out: int - :ivar invalid_directories_processed: To indicate directories renamed. - :vartype invalid_directories_processed: int - :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 - :ivar error: Error, if any, in the stage. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] - :ivar serial_number: Disk Serial Number. - :vartype serial_number: str - :ivar copy_status: The Status of the copy. Known values are: "NotStarted", "InProgress", - "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", - "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", - "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", - "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". - :vartype copy_status: str or ~azure.mgmt.databox.models.CopyStatus - """ - - _validation = { - "storage_account_name": {"readonly": True}, - "transfer_type": {"readonly": True}, - "data_account_type": {"readonly": True}, - "account_id": {"readonly": True}, - "bytes_processed": {"readonly": True}, - "total_bytes_to_process": {"readonly": True}, - "files_processed": {"readonly": True}, - "total_files_to_process": {"readonly": True}, - "invalid_files_processed": {"readonly": True}, - "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}, - "error": {"readonly": True}, - "actions": {"readonly": True}, - "serial_number": {"readonly": True}, - "copy_status": {"readonly": True}, - } - - _attribute_map = { - "storage_account_name": {"key": "storageAccountName", "type": "str"}, - "transfer_type": {"key": "transferType", "type": "str"}, - "data_account_type": {"key": "dataAccountType", "type": "str"}, - "account_id": {"key": "accountId", "type": "str"}, - "bytes_processed": {"key": "bytesProcessed", "type": "int"}, - "total_bytes_to_process": {"key": "totalBytesToProcess", "type": "int"}, - "files_processed": {"key": "filesProcessed", "type": "int"}, - "total_files_to_process": {"key": "totalFilesToProcess", "type": "int"}, - "invalid_files_processed": {"key": "invalidFilesProcessed", "type": "int"}, - "invalid_file_bytes_uploaded": {"key": "invalidFileBytesUploaded", "type": "int"}, - "renamed_container_count": {"key": "renamedContainerCount", "type": "int"}, - "files_errored_out": {"key": "filesErroredOut", "type": "int"}, - "directories_errored_out": {"key": "directoriesErroredOut", "type": "int"}, - "invalid_directories_processed": {"key": "invalidDirectoriesProcessed", "type": "int"}, - "is_enumeration_in_progress": {"key": "isEnumerationInProgress", "type": "bool"}, - "error": {"key": "error", "type": "CloudError"}, - "actions": {"key": "actions", "type": "[str]"}, - "serial_number": {"key": "serialNumber", "type": "str"}, - "copy_status": {"key": "copyStatus", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.copy_status = None - - -class DataBoxDiskJobDetails(JobDetails): - """DataBox Disk Job 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 server. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :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 reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - :ivar device_erasure_details: Holds device data erasure details. - :vartype device_erasure_details: ~azure.mgmt.databox.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :vartype expected_data_size_in_tera_bytes: int - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: ~azure.mgmt.databox.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.models.DatacenterAddressResponse - :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", - "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", - "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", - "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", - "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", - "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", - "BJS20", "BL24", "IDC5", "TYO23", "CPQ21", "NTG20", "DXB23", "DSM11", "OSA23", and "AMS25". - :vartype data_center_code: str or ~azure.mgmt.databox.models.DataCenterCode - :ivar 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. - :vartype preferred_disks: dict[str, int] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] - :ivar granular_copy_progress: Copy progress per disk. - :vartype granular_copy_progress: - list[~azure.mgmt.databox.models.DataBoxDiskGranularCopyProgress] - :ivar granular_copy_log_details: Copy progress per disk. - :vartype granular_copy_log_details: - list[~azure.mgmt.databox.models.DataBoxDiskGranularCopyLogDetails] - :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] - :ivar passkey: User entered passkey for DataBox Disk job. - :vartype passkey: str - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"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}, - "device_erasure_details": {"readonly": True}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"readonly": True}, - "datacenter_address": {"readonly": True}, - "data_center_code": {"readonly": True}, - "copy_progress": {"readonly": True}, - "granular_copy_progress": {"readonly": True}, - "granular_copy_log_details": {"readonly": True}, - "disks_and_size_details": {"readonly": True}, - } - - _attribute_map = { - "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"}, - "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"}, - "reverse_shipping_details": {"key": "reverseShippingDetails", "type": "ReverseShippingDetails"}, - "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"}, - "device_erasure_details": {"key": "deviceErasureDetails", "type": "DeviceErasureDetails"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "actions": {"key": "actions", "type": "[str]"}, - "last_mitigation_action_on_job": {"key": "lastMitigationActionOnJob", "type": "LastMitigationActionOnJob"}, - "datacenter_address": {"key": "datacenterAddress", "type": "DatacenterAddressResponse"}, - "data_center_code": {"key": "dataCenterCode", "type": "str"}, - "preferred_disks": {"key": "preferredDisks", "type": "{int}"}, - "copy_progress": {"key": "copyProgress", "type": "[DataBoxDiskCopyProgress]"}, - "granular_copy_progress": {"key": "granularCopyProgress", "type": "[DataBoxDiskGranularCopyProgress]"}, - "granular_copy_log_details": {"key": "granularCopyLogDetails", "type": "[DataBoxDiskGranularCopyLogDetails]"}, - "disks_and_size_details": {"key": "disksAndSizeDetails", "type": "{int}"}, - "passkey": {"key": "passkey", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: Optional["_models.ShippingAddress"] = None, - data_import_details: Optional[List["_models.DataImportDetails"]] = None, - data_export_details: Optional[List["_models.DataExportDetails"]] = None, - preferences: Optional["_models.Preferences"] = None, - reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, - key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, - expected_data_size_in_tera_bytes: Optional[int] = None, - preferred_disks: Optional[Dict[str, int]] = None, - passkey: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :paramtype expected_data_size_in_tera_bytes: int - :keyword 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. - :paramtype preferred_disks: dict[str, int] - :keyword passkey: User entered passkey for DataBox Disk job. - :paramtype passkey: str - """ - super().__init__( - contact_details=contact_details, - shipping_address=shipping_address, - data_import_details=data_import_details, - data_export_details=data_export_details, - preferences=preferences, - reverse_shipping_details=reverse_shipping_details, - key_encryption_key=key_encryption_key, - expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, - **kwargs - ) - self.job_details_type: str = "DataBoxDisk" - self.preferred_disks = preferred_disks - self.copy_progress = None - self.granular_copy_progress = None - self.granular_copy_log_details = None - self.disks_and_size_details = None - self.passkey = passkey - - -class DataBoxDiskJobSecrets(JobSecrets): - """The secrets related to disk 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 server. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.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. - :vartype is_passkey_user_defined: bool - """ - - _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 = { - "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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.job_secrets_type: str = "DataBoxDisk" - self.disk_secrets = None - self.pass_key = None - self.is_passkey_user_defined = None - - -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. - - All required parameters must be populated in order to send to server. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.copy_log_details_type: str = "DataBoxHeavy" - self.account_name = None - self.copy_log_link = None - 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. - - All required parameters must be populated in order to send to server. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :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 reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - :ivar device_erasure_details: Holds device data erasure details. - :vartype device_erasure_details: ~azure.mgmt.databox.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :vartype expected_data_size_in_tera_bytes: int - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: ~azure.mgmt.databox.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.models.DatacenterAddressResponse - :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", - "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", - "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", - "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", - "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", - "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", - "BJS20", "BL24", "IDC5", "TYO23", "CPQ21", "NTG20", "DXB23", "DSM11", "OSA23", and "AMS25". - :vartype data_center_code: str or ~azure.mgmt.databox.models.DataCenterCode - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :ivar 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 : @#-$%^!+=;:_()]+. - :vartype device_password: str - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"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}, - "device_erasure_details": {"readonly": True}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"readonly": True}, - "datacenter_address": {"readonly": True}, - "data_center_code": {"readonly": True}, - "copy_progress": {"readonly": True}, - } - - _attribute_map = { - "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"}, - "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"}, - "reverse_shipping_details": {"key": "reverseShippingDetails", "type": "ReverseShippingDetails"}, - "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"}, - "device_erasure_details": {"key": "deviceErasureDetails", "type": "DeviceErasureDetails"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "actions": {"key": "actions", "type": "[str]"}, - "last_mitigation_action_on_job": {"key": "lastMitigationActionOnJob", "type": "LastMitigationActionOnJob"}, - "datacenter_address": {"key": "datacenterAddress", "type": "DatacenterAddressResponse"}, - "data_center_code": {"key": "dataCenterCode", "type": "str"}, - "copy_progress": {"key": "copyProgress", "type": "[CopyProgress]"}, - "device_password": {"key": "devicePassword", "type": "str"}, - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: Optional["_models.ShippingAddress"] = None, - data_import_details: Optional[List["_models.DataImportDetails"]] = None, - data_export_details: Optional[List["_models.DataExportDetails"]] = None, - preferences: Optional["_models.Preferences"] = None, - reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, - key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, - expected_data_size_in_tera_bytes: Optional[int] = None, - device_password: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :paramtype expected_data_size_in_tera_bytes: int - :keyword 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 : @#-$%^!+=;:_()]+. - :paramtype device_password: str - """ - super().__init__( - contact_details=contact_details, - shipping_address=shipping_address, - data_import_details=data_import_details, - data_export_details=data_export_details, - preferences=preferences, - reverse_shipping_details=reverse_shipping_details, - key_encryption_key=key_encryption_key, - expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, - **kwargs - ) - self.job_details_type: str = "DataBoxHeavy" - self.copy_progress = None - self.device_password = device_password - - -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. - - All required parameters must be populated in order to send to server. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :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] - """ - - _validation = { - "job_secrets_type": {"required": True}, - "dc_access_security_code": {"readonly": True}, - "error": {"readonly": True}, - "cabinet_pod_secrets": {"readonly": True}, - } - - _attribute_map = { - "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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.job_secrets_type: str = "DataBoxHeavy" - self.cabinet_pod_secrets = None - - -class DataBoxHeavySecret(_serialization.Model): - """The secrets related to a databox heavy. - - 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 - :ivar device_password: Password for out of the box experience on device. - :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. - :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] - """ - - _validation = { - "device_serial_number": {"readonly": True}, - "device_password": {"readonly": True}, - "network_configurations": {"readonly": True}, - "encoded_validation_cert_pub_key": {"readonly": True}, - "account_credential_details": {"readonly": True}, - } - - _attribute_map = { - "device_serial_number": {"key": "deviceSerialNumber", "type": "str"}, - "device_password": {"key": "devicePassword", "type": "str"}, - "network_configurations": {"key": "networkConfigurations", "type": "[ApplianceNetworkConfiguration]"}, - "encoded_validation_cert_pub_key": {"key": "encodedValidationCertPubKey", "type": "str"}, - "account_credential_details": {"key": "accountCredentialDetails", "type": "[AccountCredentialDetails]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.device_serial_number = None - self.device_password = None - self.network_configurations = None - self.encoded_validation_cert_pub_key = None - self.account_credential_details = None - - -class DataBoxJobDetails(JobDetails): - """Databox Job 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 server. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :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 reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - :ivar device_erasure_details: Holds device data erasure details. - :vartype device_erasure_details: ~azure.mgmt.databox.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :vartype expected_data_size_in_tera_bytes: int - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: ~azure.mgmt.databox.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.models.DatacenterAddressResponse - :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", - "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", - "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", - "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", - "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", - "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", - "BJS20", "BL24", "IDC5", "TYO23", "CPQ21", "NTG20", "DXB23", "DSM11", "OSA23", and "AMS25". - :vartype data_center_code: str or ~azure.mgmt.databox.models.DataCenterCode - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :ivar 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 : @#-$%^!+=;:_()]+. - :vartype device_password: str - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"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}, - "device_erasure_details": {"readonly": True}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"readonly": True}, - "datacenter_address": {"readonly": True}, - "data_center_code": {"readonly": True}, - "copy_progress": {"readonly": True}, - } - - _attribute_map = { - "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"}, - "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"}, - "reverse_shipping_details": {"key": "reverseShippingDetails", "type": "ReverseShippingDetails"}, - "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"}, - "device_erasure_details": {"key": "deviceErasureDetails", "type": "DeviceErasureDetails"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "actions": {"key": "actions", "type": "[str]"}, - "last_mitigation_action_on_job": {"key": "lastMitigationActionOnJob", "type": "LastMitigationActionOnJob"}, - "datacenter_address": {"key": "datacenterAddress", "type": "DatacenterAddressResponse"}, - "data_center_code": {"key": "dataCenterCode", "type": "str"}, - "copy_progress": {"key": "copyProgress", "type": "[CopyProgress]"}, - "device_password": {"key": "devicePassword", "type": "str"}, - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: Optional["_models.ShippingAddress"] = None, - data_import_details: Optional[List["_models.DataImportDetails"]] = None, - data_export_details: Optional[List["_models.DataExportDetails"]] = None, - preferences: Optional["_models.Preferences"] = None, - reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, - key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, - expected_data_size_in_tera_bytes: Optional[int] = None, - device_password: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :paramtype expected_data_size_in_tera_bytes: int - :keyword 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 : @#-$%^!+=;:_()]+. - :paramtype device_password: str - """ - super().__init__( - contact_details=contact_details, - shipping_address=shipping_address, - data_import_details=data_import_details, - data_export_details=data_export_details, - preferences=preferences, - reverse_shipping_details=reverse_shipping_details, - key_encryption_key=key_encryption_key, - expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, - **kwargs - ) - self.job_details_type: str = "DataBox" - self.copy_progress = None - self.device_password = device_password - - -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 server. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] - """ - - _validation = { - "job_secrets_type": {"required": True}, - "dc_access_security_code": {"readonly": True}, - "error": {"readonly": True}, - } - - _attribute_map = { - "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, *, pod_secrets: Optional[List["_models.DataBoxSecret"]] = None, **kwargs: Any) -> None: - """ - :keyword pod_secrets: Contains the list of secret objects for a job. - :paramtype pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] - """ - super().__init__(**kwargs) - self.job_secrets_type: str = "DataBox" - self.pod_secrets = pod_secrets - - -class ScheduleAvailabilityRequest(_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 - - All required parameters must be populated in order to send to server. - - :ivar storage_location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :vartype storage_location: str - :ivar sku_name: Sku Name for which the order is to be scheduled. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - "country": {"key": "country", "type": "str"}, - "model": {"key": "model", "type": "str"}, - } - - _subtype_map = { - "sku_name": { - "DataBox": "DataBoxScheduleAvailabilityRequest", - "DataBoxDisk": "DiskScheduleAvailabilityRequest", - "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", - } - } - - def __init__( - self, - *, - storage_location: str, - country: Optional[str] = None, - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :paramtype storage_location: str - :keyword country: Country in which storage location should be supported. - :paramtype country: str - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name: Optional[str] = None - self.country = country - self.model = model - - -class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling data box orders orders. - - All required parameters must be populated in order to send to server. - - :ivar storage_location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :vartype storage_location: str - :ivar sku_name: Sku Name for which the order is to be scheduled. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - "country": {"key": "country", "type": "str"}, - "model": {"key": "model", "type": "str"}, - } - - def __init__( - self, - *, - storage_location: str, - country: Optional[str] = None, - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :paramtype storage_location: str - :keyword country: Country in which storage location should be supported. - :paramtype country: str - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(storage_location=storage_location, country=country, model=model, **kwargs) - self.sku_name: str = "DataBox" - - -class DataBoxSecret(_serialization.Model): - """The secrets related to a DataBox. - - 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 - :ivar device_password: Password for out of the box experience on device. - :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. - :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] - """ - - _validation = { - "device_serial_number": {"readonly": True}, - "device_password": {"readonly": True}, - "network_configurations": {"readonly": True}, - "encoded_validation_cert_pub_key": {"readonly": True}, - "account_credential_details": {"readonly": True}, - } - - _attribute_map = { - "device_serial_number": {"key": "deviceSerialNumber", "type": "str"}, - "device_password": {"key": "devicePassword", "type": "str"}, - "network_configurations": {"key": "networkConfigurations", "type": "[ApplianceNetworkConfiguration]"}, - "encoded_validation_cert_pub_key": {"key": "encodedValidationCertPubKey", "type": "str"}, - "account_credential_details": {"key": "accountCredentialDetails", "type": "[AccountCredentialDetails]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.device_serial_number = None - self.device_password = None - self.network_configurations = None - self.encoded_validation_cert_pub_key = None - self.account_credential_details = None - - -class DatacenterAddressResponse(_serialization.Model): - """Datacenter address for given storage location. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DatacenterAddressInstructionResponse, DatacenterAddressLocationResponse - - 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 server. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or ~azure.mgmt.databox.models.DatacenterAddressType - :ivar supported_carriers_for_return_shipment: List of supported carriers for return shipment. - :vartype supported_carriers_for_return_shipment: list[str] - :ivar data_center_azure_location: Azure Location where the Data Center serves primarily. - :vartype data_center_azure_location: str - """ - - _validation = { - "datacenter_address_type": {"required": True}, - "supported_carriers_for_return_shipment": {"readonly": True}, - "data_center_azure_location": {"readonly": True}, - } - - _attribute_map = { - "datacenter_address_type": {"key": "datacenterAddressType", "type": "str"}, - "supported_carriers_for_return_shipment": {"key": "supportedCarriersForReturnShipment", "type": "[str]"}, - "data_center_azure_location": {"key": "dataCenterAzureLocation", "type": "str"}, - } - - _subtype_map = { - "datacenter_address_type": { - "DatacenterAddressInstruction": "DatacenterAddressInstructionResponse", - "DatacenterAddressLocation": "DatacenterAddressLocationResponse", - } - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.datacenter_address_type: Optional[str] = None - self.supported_carriers_for_return_shipment = None - self.data_center_azure_location = None - - -class DatacenterAddressInstructionResponse(DatacenterAddressResponse): - """Datacenter instruction for given storage location. - - 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 server. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or ~azure.mgmt.databox.models.DatacenterAddressType - :ivar supported_carriers_for_return_shipment: List of supported carriers for return shipment. - :vartype supported_carriers_for_return_shipment: list[str] - :ivar data_center_azure_location: Azure Location where the Data Center serves primarily. - :vartype data_center_azure_location: str - :ivar communication_instruction: Data center communication instruction. - :vartype communication_instruction: str - """ - - _validation = { - "datacenter_address_type": {"required": True}, - "supported_carriers_for_return_shipment": {"readonly": True}, - "data_center_azure_location": {"readonly": True}, - "communication_instruction": {"readonly": True}, - } - - _attribute_map = { - "datacenter_address_type": {"key": "datacenterAddressType", "type": "str"}, - "supported_carriers_for_return_shipment": {"key": "supportedCarriersForReturnShipment", "type": "[str]"}, - "data_center_azure_location": {"key": "dataCenterAzureLocation", "type": "str"}, - "communication_instruction": {"key": "communicationInstruction", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.datacenter_address_type: str = "DatacenterAddressInstruction" - self.communication_instruction = None - - -class DatacenterAddressLocationResponse(DatacenterAddressResponse): - """Datacenter address for given storage location. - - 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 server. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or ~azure.mgmt.databox.models.DatacenterAddressType - :ivar supported_carriers_for_return_shipment: List of supported carriers for return shipment. - :vartype supported_carriers_for_return_shipment: list[str] - :ivar data_center_azure_location: Azure Location where the Data Center serves primarily. - :vartype data_center_azure_location: str - :ivar contact_person_name: Contact person name. - :vartype contact_person_name: str - :ivar company: Company name. - :vartype company: str - :ivar street1: Street address line 1. - :vartype street1: str - :ivar street2: Street address line 2. - :vartype street2: str - :ivar street3: Street address line 3. - :vartype street3: str - :ivar city: City name. - :vartype city: str - :ivar state: name of the state. - :vartype state: str - :ivar zip: Zip code. - :vartype zip: str - :ivar country: name of the country. - :vartype country: str - :ivar phone: Phone number. - :vartype phone: str - :ivar phone_extension: Phone extension. - :vartype phone_extension: str - :ivar address_type: Address type. - :vartype address_type: str - :ivar additional_shipping_information: Special instruction for shipping. - :vartype additional_shipping_information: str - """ - - _validation = { - "datacenter_address_type": {"required": True}, - "supported_carriers_for_return_shipment": {"readonly": True}, - "data_center_azure_location": {"readonly": True}, - "contact_person_name": {"readonly": True}, - "company": {"readonly": True}, - "street1": {"readonly": True}, - "street2": {"readonly": True}, - "street3": {"readonly": True}, - "city": {"readonly": True}, - "state": {"readonly": True}, - "zip": {"readonly": True}, - "country": {"readonly": True}, - "phone": {"readonly": True}, - "phone_extension": {"readonly": True}, - "address_type": {"readonly": True}, - "additional_shipping_information": {"readonly": True}, - } - - _attribute_map = { - "datacenter_address_type": {"key": "datacenterAddressType", "type": "str"}, - "supported_carriers_for_return_shipment": {"key": "supportedCarriersForReturnShipment", "type": "[str]"}, - "data_center_azure_location": {"key": "dataCenterAzureLocation", "type": "str"}, - "contact_person_name": {"key": "contactPersonName", "type": "str"}, - "company": {"key": "company", "type": "str"}, - "street1": {"key": "street1", "type": "str"}, - "street2": {"key": "street2", "type": "str"}, - "street3": {"key": "street3", "type": "str"}, - "city": {"key": "city", "type": "str"}, - "state": {"key": "state", "type": "str"}, - "zip": {"key": "zip", "type": "str"}, - "country": {"key": "country", "type": "str"}, - "phone": {"key": "phone", "type": "str"}, - "phone_extension": {"key": "phoneExtension", "type": "str"}, - "address_type": {"key": "addressType", "type": "str"}, - "additional_shipping_information": {"key": "additionalShippingInformation", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.datacenter_address_type: str = "DatacenterAddressLocation" - self.contact_person_name = None - self.company = None - self.street1 = None - self.street2 = None - self.street3 = None - self.city = None - self.state = None - self.zip = None - self.country = None - self.phone = None - self.phone_extension = None - self.address_type = None - self.additional_shipping_information = None - - -class DatacenterAddressRequest(_serialization.Model): - """Request body to get the datacenter address. - - All required parameters must be populated in order to send to server. - - :ivar storage_location: Storage location. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :vartype storage_location: str - :ivar sku_name: Sku Name for which the data center address requested. Required. Known values - are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - "model": {"key": "model", "type": "str"}, - } - - def __init__( - self, - *, - storage_location: str, - sku_name: Union[str, "_models.SkuName"], - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_location: Storage location. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :paramtype storage_location: str - :keyword sku_name: Sku Name for which the data center address requested. Required. Known values - are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype sku_name: str or ~azure.mgmt.databox.models.SkuName - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name = sku_name - self.model = model - - -class DataExportDetails(_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 server. - - :ivar transfer_configuration: Configuration for the data transfer. Required. - :vartype transfer_configuration: ~azure.mgmt.databox.models.TransferConfiguration - :ivar log_collection_level: Level of the logs to be collected. Known values are: "Error" and - "Verbose". - :vartype log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.models.DataAccountDetails - """ - - _validation = { - "transfer_configuration": {"required": True}, - "account_details": {"required": True}, - } - - _attribute_map = { - "transfer_configuration": {"key": "transferConfiguration", "type": "TransferConfiguration"}, - "log_collection_level": {"key": "logCollectionLevel", "type": "str"}, - "account_details": {"key": "accountDetails", "type": "DataAccountDetails"}, - } - - def __init__( - self, - *, - transfer_configuration: "_models.TransferConfiguration", - account_details: "_models.DataAccountDetails", - log_collection_level: Optional[Union[str, "_models.LogCollectionLevel"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword transfer_configuration: Configuration for the data transfer. Required. - :paramtype transfer_configuration: ~azure.mgmt.databox.models.TransferConfiguration - :keyword log_collection_level: Level of the logs to be collected. Known values are: "Error" and - "Verbose". - :paramtype log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.models.DataAccountDetails - """ - super().__init__(**kwargs) - self.transfer_configuration = transfer_configuration - self.log_collection_level = log_collection_level - self.account_details = account_details - - -class DataImportDetails(_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 server. - - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.models.DataAccountDetails - :ivar log_collection_level: Level of the logs to be collected. Known values are: "Error" and - "Verbose". - :vartype log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - """ - - _validation = { - "account_details": {"required": True}, - } - - _attribute_map = { - "account_details": {"key": "accountDetails", "type": "DataAccountDetails"}, - "log_collection_level": {"key": "logCollectionLevel", "type": "str"}, - } - - def __init__( - self, - *, - account_details: "_models.DataAccountDetails", - log_collection_level: Optional[Union[str, "_models.LogCollectionLevel"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.models.DataAccountDetails - :keyword log_collection_level: Level of the logs to be collected. Known values are: "Error" and - "Verbose". - :paramtype log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - """ - super().__init__(**kwargs) - self.account_details = account_details - self.log_collection_level = log_collection_level - - -class DataLocationToServiceLocationMap(_serialization.Model): - """Map of data location to service location. - - 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 - """ - - _validation = { - "data_location": {"readonly": True}, - "service_location": {"readonly": True}, - } - - _attribute_map = { - "data_location": {"key": "dataLocation", "type": "str"}, - "service_location": {"key": "serviceLocation", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.data_location = None - self.service_location = None - - -class DataTransferDetailsValidationRequest(ValidationInputRequest): - """Request to validate export and import data details. - - All required parameters must be populated in order to send to server. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar data_export_details: List of DataTransfer details to be used to export data from azure. - :vartype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :ivar data_import_details: List of DataTransfer details to be used to import data to azure. - :vartype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - "transfer_type": {"required": True}, - } - - _attribute_map = { - "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"}, - "model": {"key": "model", "type": "str"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - transfer_type: Union[str, "_models.TransferType"], - data_export_details: Optional[List["_models.DataExportDetails"]] = None, - data_import_details: Optional[List["_models.DataImportDetails"]] = None, - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword data_export_details: List of DataTransfer details to be used to export data from - azure. - :paramtype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :keyword data_import_details: List of DataTransfer details to be used to import data to azure. - :paramtype data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :keyword device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype device_type: str or ~azure.mgmt.databox.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateDataTransferDetails" - self.data_export_details = data_export_details - self.data_import_details = data_import_details - self.device_type = device_type - self.transfer_type = transfer_type - self.model = model - - -class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): # pylint: disable=name-too-long - """Properties of data transfer details validation response. - - 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 server. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", - and "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - "validation_type": {"required": True}, - "error": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "error": {"key": "error", "type": "CloudError"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateDataTransferDetails" - self.status = None - - -class DcAccessSecurityCode(_serialization.Model): - """Dc access security code. - - :ivar reverse_dc_access_code: Reverse Dc access security code. - :vartype reverse_dc_access_code: str - :ivar forward_dc_access_code: Forward Dc access security code. - :vartype forward_dc_access_code: str - """ - - _attribute_map = { - "reverse_dc_access_code": {"key": "reverseDCAccessCode", "type": "str"}, - "forward_dc_access_code": {"key": "forwardDCAccessCode", "type": "str"}, - } - - def __init__( - self, - *, - reverse_dc_access_code: Optional[str] = None, - forward_dc_access_code: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword reverse_dc_access_code: Reverse Dc access security code. - :paramtype reverse_dc_access_code: str - :keyword forward_dc_access_code: Forward Dc access security code. - :paramtype forward_dc_access_code: str - """ - super().__init__(**kwargs) - self.reverse_dc_access_code = reverse_dc_access_code - self.forward_dc_access_code = forward_dc_access_code - - -class Details(_serialization.Model): - """Details. - - All required parameters must be populated in order to send to server. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - """ - - _validation = { - "code": {"required": True}, - "message": {"required": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, *, code: str, message: str, **kwargs: Any) -> None: - """ - :keyword code: Required. - :paramtype code: str - :keyword message: Required. - :paramtype message: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - - -class DeviceCapabilityDetails(_serialization.Model): - """Device capability details for a given sku for a given region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar hardware_encryption: Hardware encryption support for a given sku for a given region. - Known values are: "Enabled" and "Disabled". - :vartype hardware_encryption: str or ~azure.mgmt.databox.models.HardwareEncryption - """ - - _validation = { - "hardware_encryption": {"readonly": True}, - } - - _attribute_map = { - "hardware_encryption": {"key": "hardwareEncryption", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.hardware_encryption = None - - -class DeviceCapabilityRequest(_serialization.Model): - """Request body to get the device capabilities for given sku. - - :ivar sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", - and "DataBoxCustomerDisk". - :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - "model": {"key": "model", "type": "str"}, - } - - def __init__( - self, - *, - sku_name: Optional[Union[str, "_models.SkuName"]] = None, - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype sku_name: str or ~azure.mgmt.databox.models.SkuName - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - self.model = model - - -class DeviceCapabilityResponse(_serialization.Model): - """Device capabilities for given sku in a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_capability_details: List of device capabilities available for a given region and a - given sku. - :vartype device_capability_details: list[~azure.mgmt.databox.models.DeviceCapabilityDetails] - """ - - _validation = { - "device_capability_details": {"readonly": True}, - } - - _attribute_map = { - "device_capability_details": {"key": "deviceCapabilityDetails", "type": "[DeviceCapabilityDetails]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.device_capability_details = None - - -class DeviceErasureDetails(_serialization.Model): - """Device erasure details with erasure completion status and erasureordestructionlog sas key. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_erasure_status: Holds the device erasure completion status. Known values are: - "None", "InProgress", "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", - "WaitingForCustomerAction", "SucceededWithWarnings", "WaitingForCustomerActionForKek", - "WaitingForCustomerActionForCleanUp", "CustomerActionPerformedForCleanUp", and - "CustomerActionPerformed". - :vartype device_erasure_status: str or ~azure.mgmt.databox.models.StageStatus - :ivar erasure_or_destruction_certificate_sas_key: Shared access key to download cleanup or - destruction certificate for device. - :vartype erasure_or_destruction_certificate_sas_key: str - """ - - _validation = { - "device_erasure_status": {"readonly": True}, - "erasure_or_destruction_certificate_sas_key": {"readonly": True}, - } - - _attribute_map = { - "device_erasure_status": {"key": "deviceErasureStatus", "type": "str"}, - "erasure_or_destruction_certificate_sas_key": {"key": "erasureOrDestructionCertificateSasKey", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.device_erasure_status = None - self.erasure_or_destruction_certificate_sas_key = None - - -class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling disk orders. - - All required parameters must be populated in order to send to server. - - :ivar storage_location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :vartype storage_location: str - :ivar sku_name: Sku Name for which the order is to be scheduled. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. Required. - :vartype expected_data_size_in_tera_bytes: int - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - "expected_data_size_in_tera_bytes": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - "country": {"key": "country", "type": "str"}, - "model": {"key": "model", "type": "str"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - } - - def __init__( - self, - *, - storage_location: str, - expected_data_size_in_tera_bytes: int, - country: Optional[str] = None, - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :paramtype storage_location: str - :keyword country: Country in which storage location should be supported. - :paramtype country: str - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. Required. - :paramtype expected_data_size_in_tera_bytes: int - """ - super().__init__(storage_location=storage_location, country=country, model=model, **kwargs) - self.sku_name: str = "DataBoxDisk" - self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes - - -class DiskSecret(_serialization.Model): - """Contains all the secrets of a Disk. - - 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. - :vartype bit_locker_key: str - """ - - _validation = { - "disk_serial_number": {"readonly": True}, - "bit_locker_key": {"readonly": True}, - } - - _attribute_map = { - "disk_serial_number": {"key": "diskSerialNumber", "type": "str"}, - "bit_locker_key": {"key": "bitLockerKey", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.disk_serial_number = None - self.bit_locker_key = None - - -class EncryptionPreferences(_serialization.Model): - """Preferences related to the Encryption. - - :ivar double_encryption: Defines secondary layer of software-based encryption enablement. Known - values are: "Enabled" and "Disabled". - :vartype double_encryption: str or ~azure.mgmt.databox.models.DoubleEncryption - :ivar hardware_encryption: Defines Hardware level encryption (Only for disk). Known values are: - "Enabled" and "Disabled". - :vartype hardware_encryption: str or ~azure.mgmt.databox.models.HardwareEncryption - """ - - _attribute_map = { - "double_encryption": {"key": "doubleEncryption", "type": "str"}, - "hardware_encryption": {"key": "hardwareEncryption", "type": "str"}, - } - - def __init__( - self, - *, - double_encryption: Union[str, "_models.DoubleEncryption"] = "Disabled", - hardware_encryption: Optional[Union[str, "_models.HardwareEncryption"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword double_encryption: Defines secondary layer of software-based encryption enablement. - Known values are: "Enabled" and "Disabled". - :paramtype double_encryption: str or ~azure.mgmt.databox.models.DoubleEncryption - :keyword hardware_encryption: Defines Hardware level encryption (Only for disk). Known values - are: "Enabled" and "Disabled". - :paramtype hardware_encryption: str or ~azure.mgmt.databox.models.HardwareEncryption - """ - super().__init__(**kwargs) - self.double_encryption = double_encryption - self.hardware_encryption = hardware_encryption - - -class ErrorDetail(_serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to server. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar details: - :vartype details: list[~azure.mgmt.databox.models.Details] - :ivar target: - :vartype target: str - """ - - _validation = { - "code": {"required": True}, - "message": {"required": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "details": {"key": "details", "type": "[Details]"}, - "target": {"key": "target", "type": "str"}, - } - - def __init__( - self, - *, - code: str, - message: str, - details: Optional[List["_models.Details"]] = None, - target: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword code: Required. - :paramtype code: str - :keyword message: Required. - :paramtype message: str - :keyword details: - :paramtype details: list[~azure.mgmt.databox.models.Details] - :keyword target: - :paramtype target: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.details = details - self.target = target - - -class ExportDiskDetails(_serialization.Model): - """Export disk details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar manifest_file: The relative path of the manifest file on the disk. - :vartype manifest_file: str - :ivar manifest_hash: The Base16-encoded MD5 hash of the manifest file on the disk. - :vartype manifest_hash: str - :ivar backup_manifest_cloud_path: Path to backed up manifest, only returned if - enableManifestBackup is true. - :vartype backup_manifest_cloud_path: str - """ - - _validation = { - "manifest_file": {"readonly": True}, - "manifest_hash": {"readonly": True}, - "backup_manifest_cloud_path": {"readonly": True}, - } - - _attribute_map = { - "manifest_file": {"key": "manifestFile", "type": "str"}, - "manifest_hash": {"key": "manifestHash", "type": "str"}, - "backup_manifest_cloud_path": {"key": "backupManifestCloudPath", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.manifest_file = None - self.manifest_hash = None - self.backup_manifest_cloud_path = None - - -class FilterFileDetails(_serialization.Model): - """Details of the filter files to be used for data transfer. - - All required parameters must be populated in order to send to server. - - :ivar filter_file_type: Type of the filter file. Required. Known values are: "AzureBlob" and - "AzureFile". - :vartype filter_file_type: str or ~azure.mgmt.databox.models.FilterFileType - :ivar filter_file_path: Path of the file that contains the details of all items to transfer. - Required. - :vartype filter_file_path: str - """ - - _validation = { - "filter_file_type": {"required": True}, - "filter_file_path": {"required": True}, - } - - _attribute_map = { - "filter_file_type": {"key": "filterFileType", "type": "str"}, - "filter_file_path": {"key": "filterFilePath", "type": "str"}, - } - - def __init__( - self, *, filter_file_type: Union[str, "_models.FilterFileType"], filter_file_path: str, **kwargs: Any - ) -> None: - """ - :keyword filter_file_type: Type of the filter file. Required. Known values are: "AzureBlob" and - "AzureFile". - :paramtype filter_file_type: str or ~azure.mgmt.databox.models.FilterFileType - :keyword filter_file_path: Path of the file that contains the details of all items to transfer. - Required. - :paramtype filter_file_path: str - """ - super().__init__(**kwargs) - self.filter_file_type = filter_file_type - self.filter_file_path = filter_file_path - - -class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling heavy orders. - - All required parameters must be populated in order to send to server. - - :ivar storage_location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :vartype storage_location: str - :ivar sku_name: Sku Name for which the order is to be scheduled. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - "country": {"key": "country", "type": "str"}, - "model": {"key": "model", "type": "str"}, - } - - def __init__( - self, - *, - storage_location: str, - country: Optional[str] = None, - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :paramtype storage_location: str - :keyword country: Country in which storage location should be supported. - :paramtype country: str - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(storage_location=storage_location, country=country, model=model, **kwargs) - self.sku_name: str = "DataBoxHeavy" - - -class IdentityProperties(_serialization.Model): - """Managed identity properties. - - :ivar type: Managed service identity type. - :vartype type: str - :ivar user_assigned: User assigned identity properties. - :vartype user_assigned: ~azure.mgmt.databox.models.UserAssignedProperties - """ - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "user_assigned": {"key": "userAssigned", "type": "UserAssignedProperties"}, - } - - def __init__( - self, - *, - type: Optional[str] = None, - user_assigned: Optional["_models.UserAssignedProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword type: Managed service identity type. - :paramtype type: str - :keyword user_assigned: User assigned identity properties. - :paramtype user_assigned: ~azure.mgmt.databox.models.UserAssignedProperties - """ - super().__init__(**kwargs) - self.type = type - self.user_assigned = user_assigned - - -class ImportDiskDetails(_serialization.Model): - """Import disk 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 server. - - :ivar manifest_file: The relative path of the manifest file on the disk. Required. - :vartype manifest_file: str - :ivar manifest_hash: The Base16-encoded MD5 hash of the manifest file on the disk. Required. - :vartype manifest_hash: str - :ivar bit_locker_key: BitLocker key used to encrypt the disk. Required. - :vartype bit_locker_key: str - :ivar backup_manifest_cloud_path: Path to backed up manifest, only returned if - enableManifestBackup is true. - :vartype backup_manifest_cloud_path: str - """ - - _validation = { - "manifest_file": {"required": True}, - "manifest_hash": {"required": True}, - "bit_locker_key": {"required": True}, - "backup_manifest_cloud_path": {"readonly": True}, - } - - _attribute_map = { - "manifest_file": {"key": "manifestFile", "type": "str"}, - "manifest_hash": {"key": "manifestHash", "type": "str"}, - "bit_locker_key": {"key": "bitLockerKey", "type": "str"}, - "backup_manifest_cloud_path": {"key": "backupManifestCloudPath", "type": "str"}, - } - - def __init__(self, *, manifest_file: str, manifest_hash: str, bit_locker_key: str, **kwargs: Any) -> None: - """ - :keyword manifest_file: The relative path of the manifest file on the disk. Required. - :paramtype manifest_file: str - :keyword manifest_hash: The Base16-encoded MD5 hash of the manifest file on the disk. Required. - :paramtype manifest_hash: str - :keyword bit_locker_key: BitLocker key used to encrypt the disk. Required. - :paramtype bit_locker_key: str - """ - super().__init__(**kwargs) - self.manifest_file = manifest_file - self.manifest_hash = manifest_hash - self.bit_locker_key = bit_locker_key - self.backup_manifest_cloud_path = None - - -class JobDelayDetails(_serialization.Model): - """Job Delay Notification details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar status: Status of notification. Known values are: "Active" and "Resolved". - :vartype status: str or ~azure.mgmt.databox.models.DelayNotificationStatus - :ivar error_code: Delay Error code. Known values are: "InternalIssueDelay", - "ActiveOrderLimitBreachedDelay", "HighDemandDelay", and "LargeNumberOfFilesDelay". - :vartype error_code: str or ~azure.mgmt.databox.models.PortalDelayErrorCode - :ivar description: Description of the delay. - :vartype description: str - :ivar start_time: Timestamp when the delay notification was created. - :vartype start_time: ~datetime.datetime - :ivar resolution_time: Timestamp when the delay notification was resolved. - :vartype resolution_time: ~datetime.datetime - """ - - _validation = { - "status": {"readonly": True}, - "error_code": {"readonly": True}, - "description": {"readonly": True}, - "start_time": {"readonly": True}, - "resolution_time": {"readonly": True}, - } - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - "error_code": {"key": "errorCode", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "start_time": {"key": "startTime", "type": "iso-8601"}, - "resolution_time": {"key": "resolutionTime", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.status = None - self.error_code = None - self.description = None - self.start_time = None - self.resolution_time = None - - -class JobDeliveryInfo(_serialization.Model): - """Additional delivery info. - - :ivar scheduled_date_time: Scheduled date time. - :vartype scheduled_date_time: ~datetime.datetime - """ - - _attribute_map = { - "scheduled_date_time": {"key": "scheduledDateTime", "type": "iso-8601"}, - } - - def __init__(self, *, scheduled_date_time: Optional[datetime.datetime] = None, **kwargs: Any) -> None: - """ - :keyword scheduled_date_time: Scheduled date time. - :paramtype scheduled_date_time: ~datetime.datetime - """ - super().__init__(**kwargs) - self.scheduled_date_time = scheduled_date_time - - -class Resource(_serialization.Model): - """Model of the Resource. - - All required parameters must be populated in order to send to server. - - :ivar 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. Required. - :vartype location: str - :ivar 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). - :vartype tags: dict[str, str] - :ivar sku: The sku type. Required. - :vartype sku: ~azure.mgmt.databox.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.models.ResourceIdentity - """ - - _validation = { - "location": {"required": True}, - "sku": {"required": True}, - } - - _attribute_map = { - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "identity": {"key": "identity", "type": "ResourceIdentity"}, - } - - def __init__( - self, - *, - location: str, - sku: "_models.Sku", - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ResourceIdentity"] = None, - **kwargs: Any - ) -> None: - """ - :keyword 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. Required. - :paramtype location: str - :keyword 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). - :paramtype tags: dict[str, str] - :keyword sku: The sku type. Required. - :paramtype sku: ~azure.mgmt.databox.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.models.ResourceIdentity - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - self.identity = identity - - -class JobResource(Resource): - """Job 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 server. - - :ivar 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. Required. - :vartype location: str - :ivar 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). - :vartype tags: dict[str, str] - :ivar sku: The sku type. Required. - :vartype sku: ~azure.mgmt.databox.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.models.ResourceIdentity - :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 - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.databox.models.SystemData - :ivar transfer_type: Type of the data transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.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. - :vartype is_shipping_address_editable: bool - :ivar reverse_shipping_details_update: The Editable status for Reverse Shipping Address and - Contact Info. Known values are: "Enabled", "Disabled", and "NotSupported". - :vartype reverse_shipping_details_update: str or - ~azure.mgmt.databox.models.ReverseShippingDetailsEditStatus - :ivar reverse_transport_preference_update: The Editable status for Reverse Transport - preferences. Known values are: "Enabled", "Disabled", and "NotSupported". - :vartype reverse_transport_preference_update: str or - ~azure.mgmt.databox.models.ReverseTransportPreferenceEditStatus - :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. Known values are: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", - "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", - "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", and "ShippedToCustomer". - :vartype status: str or ~azure.mgmt.databox.models.StageName - :ivar delayed_stage: Name of the stage where delay might be present. Known values are: - "DeviceOrdered", "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", - "DataCopy", "Completed", "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", - "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", - "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", and "ShippedToCustomer". - :vartype delayed_stage: 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.datetime - :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.models.JobDetails - :ivar cancellation_reason: Reason for cancellation. - :vartype cancellation_reason: str - :ivar delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :vartype delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: bool - :ivar all_devices_lost: Flag to indicate if all devices associated with the job are lost. - :vartype all_devices_lost: bool - """ - - _validation = { - "location": {"required": True}, - "sku": {"required": True}, - "name": {"readonly": True}, - "id": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "transfer_type": {"required": True}, - "is_cancellable": {"readonly": True}, - "is_deletable": {"readonly": True}, - "is_shipping_address_editable": {"readonly": True}, - "reverse_shipping_details_update": {"readonly": True}, - "reverse_transport_preference_update": {"readonly": True}, - "is_prepare_to_ship_enabled": {"readonly": True}, - "status": {"readonly": True}, - "delayed_stage": {"readonly": True}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "is_cancellable_without_fee": {"readonly": True}, - "all_devices_lost": {"readonly": True}, - } - - _attribute_map = { - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "identity": {"key": "identity", "type": "ResourceIdentity"}, - "name": {"key": "name", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "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"}, - "reverse_shipping_details_update": {"key": "properties.reverseShippingDetailsUpdate", "type": "str"}, - "reverse_transport_preference_update": {"key": "properties.reverseTransportPreferenceUpdate", "type": "str"}, - "is_prepare_to_ship_enabled": {"key": "properties.isPrepareToShipEnabled", "type": "bool"}, - "status": {"key": "properties.status", "type": "str"}, - "delayed_stage": {"key": "properties.delayedStage", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "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": "str"}, - "delivery_info": {"key": "properties.deliveryInfo", "type": "JobDeliveryInfo"}, - "is_cancellable_without_fee": {"key": "properties.isCancellableWithoutFee", "type": "bool"}, - "all_devices_lost": {"key": "properties.allDevicesLost", "type": "bool"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: str, - sku: "_models.Sku", - transfer_type: Union[str, "_models.TransferType"], - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ResourceIdentity"] = None, - details: Optional["_models.JobDetails"] = None, - delivery_type: Union[str, "_models.JobDeliveryType"] = "NonScheduled", - delivery_info: Optional["_models.JobDeliveryInfo"] = None, - **kwargs: Any - ) -> None: - """ - :keyword 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. Required. - :paramtype location: str - :keyword 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). - :paramtype tags: dict[str, str] - :keyword sku: The sku type. Required. - :paramtype sku: ~azure.mgmt.databox.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.models.ResourceIdentity - :keyword transfer_type: Type of the data transfer. Required. Known values are: "ImportToAzure" - and "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.models.JobDetails - :keyword delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :paramtype delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo - """ - super().__init__(location=location, tags=tags, sku=sku, identity=identity, **kwargs) - self.name = None - self.id = None - self.type = None - self.system_data = None - self.transfer_type = transfer_type - self.is_cancellable = None - self.is_deletable = None - self.is_shipping_address_editable = None - self.reverse_shipping_details_update = None - self.reverse_transport_preference_update = None - self.is_prepare_to_ship_enabled = None - self.status = None - self.delayed_stage = 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.all_devices_lost = None - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.models.JobResource] - :ivar next_link: Link for the next set of job resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[JobResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.JobResource"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of job resources. - :paramtype value: list[~azure.mgmt.databox.models.JobResource] - :keyword next_link: Link for the next set of job resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class JobResourceUpdateParameter(_serialization.Model): - """The JobResourceUpdateParameter. - - :ivar 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). - :vartype tags: dict[str, str] - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.models.ResourceIdentity - :ivar details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.models.UpdateJobDetails - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ResourceIdentity"}, - "details": {"key": "properties.details", "type": "UpdateJobDetails"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ResourceIdentity"] = None, - details: Optional["_models.UpdateJobDetails"] = None, - **kwargs: Any - ) -> None: - """ - :keyword 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). - :paramtype tags: dict[str, str] - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.models.ResourceIdentity - :keyword details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.models.UpdateJobDetails - """ - super().__init__(**kwargs) - self.tags = tags - self.identity = identity - self.details = details - - -class JobStages(_serialization.Model): - """Job stages. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar stage_name: Name of the job stage. Known values are: "DeviceOrdered", "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", - "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", - "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", and "ShippedToCustomer". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName - :ivar display_name: Display name of the job stage. - :vartype display_name: str - :ivar stage_status: Status of the job stage. Known values are: "None", "InProgress", - "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", - "WaitingForCustomerAction", "SucceededWithWarnings", "WaitingForCustomerActionForKek", - "WaitingForCustomerActionForCleanUp", "CustomerActionPerformedForCleanUp", and - "CustomerActionPerformed". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus - :ivar stage_time: Time for the job stage in UTC ISO 8601 format. - :vartype stage_time: ~datetime.datetime - :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: JSON - :ivar delay_information: Delay information for the job stages. - :vartype delay_information: list[~azure.mgmt.databox.models.JobDelayDetails] - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"readonly": True}, - "delay_information": {"readonly": True}, - } - - _attribute_map = { - "stage_name": {"key": "stageName", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "stage_status": {"key": "stageStatus", "type": "str"}, - "stage_time": {"key": "stageTime", "type": "iso-8601"}, - "job_stage_details": {"key": "jobStageDetails", "type": "object"}, - "delay_information": {"key": "delayInformation", "type": "[JobDelayDetails]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.stage_name = None - self.display_name = None - self.stage_status = None - self.stage_time = None - self.job_stage_details = None - self.delay_information = None - - -class KeyEncryptionKey(_serialization.Model): - """Encryption key containing details about key to encrypt different keys. - - All required parameters must be populated in order to send to server. - - :ivar kek_type: Type of encryption key used for key encryption. Known values are: - "MicrosoftManaged" and "CustomerManaged". - :vartype kek_type: str or ~azure.mgmt.databox.models.KekType - :ivar identity_properties: Managed identity properties used for key encryption. - :vartype identity_properties: ~azure.mgmt.databox.models.IdentityProperties - :ivar kek_url: Key encryption key. It is required in case of Customer managed KekType. - :vartype kek_url: str - :ivar kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed - KekType. - :vartype kek_vault_resource_id: str - """ - - _validation = { - "kek_type": {"required": True}, - } - - _attribute_map = { - "kek_type": {"key": "kekType", "type": "str"}, - "identity_properties": {"key": "identityProperties", "type": "IdentityProperties"}, - "kek_url": {"key": "kekUrl", "type": "str"}, - "kek_vault_resource_id": {"key": "kekVaultResourceID", "type": "str"}, - } - - def __init__( - self, - *, - kek_type: Union[str, "_models.KekType"] = "MicrosoftManaged", - identity_properties: Optional["_models.IdentityProperties"] = None, - kek_url: Optional[str] = None, - kek_vault_resource_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword kek_type: Type of encryption key used for key encryption. Known values are: - "MicrosoftManaged" and "CustomerManaged". - :paramtype kek_type: str or ~azure.mgmt.databox.models.KekType - :keyword identity_properties: Managed identity properties used for key encryption. - :paramtype identity_properties: ~azure.mgmt.databox.models.IdentityProperties - :keyword kek_url: Key encryption key. It is required in case of Customer managed KekType. - :paramtype kek_url: str - :keyword kek_vault_resource_id: Kek vault resource id. It is required in case of Customer - managed KekType. - :paramtype kek_vault_resource_id: str - """ - super().__init__(**kwargs) - self.kek_type = kek_type - self.identity_properties = identity_properties - self.kek_url = kek_url - self.kek_vault_resource_id = kek_vault_resource_id - - -class LastMitigationActionOnJob(_serialization.Model): - """Last Mitigation Action Performed On Job. - - :ivar action_date_time_in_utc: Action performed date time. - :vartype action_date_time_in_utc: ~datetime.datetime - :ivar is_performed_by_customer: Action performed by customer, - possibility is that mitigation might happen by customer or service or by ops. - :vartype is_performed_by_customer: bool - :ivar customer_resolution: Resolution code provided by customer. Known values are: "None", - "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". - :vartype customer_resolution: str or ~azure.mgmt.databox.models.CustomerResolutionCode - """ - - _attribute_map = { - "action_date_time_in_utc": {"key": "actionDateTimeInUtc", "type": "iso-8601"}, - "is_performed_by_customer": {"key": "isPerformedByCustomer", "type": "bool"}, - "customer_resolution": {"key": "customerResolution", "type": "str"}, - } - - def __init__( - self, - *, - action_date_time_in_utc: Optional[datetime.datetime] = None, - is_performed_by_customer: Optional[bool] = None, - customer_resolution: Optional[Union[str, "_models.CustomerResolutionCode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword action_date_time_in_utc: Action performed date time. - :paramtype action_date_time_in_utc: ~datetime.datetime - :keyword is_performed_by_customer: Action performed by customer, - possibility is that mitigation might happen by customer or service or by ops. - :paramtype is_performed_by_customer: bool - :keyword customer_resolution: Resolution code provided by customer. Known values are: "None", - "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". - :paramtype customer_resolution: str or ~azure.mgmt.databox.models.CustomerResolutionCode - """ - super().__init__(**kwargs) - self.action_date_time_in_utc = action_date_time_in_utc - self.is_performed_by_customer = is_performed_by_customer - self.customer_resolution = customer_resolution - - -class ManagedDiskDetails(DataAccountDetails): - """Details of the managed disks. - - All required parameters must be populated in order to send to server. - - :ivar data_account_type: Account Type of the data to be transferred. Required. Known values - are: "StorageAccount" and "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar 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 : @#-$%^!+=;:_()]+. - :vartype share_password: str - :ivar resource_group_id: Resource Group Id of the compute disks. Required. - :vartype resource_group_id: str - :ivar staging_storage_account_id: Resource Id of the storage account that can be used to copy - the vhd for staging. Required. - :vartype 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: Any - ) -> None: - """ - :keyword 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 : @#-$%^!+=;:_()]+. - :paramtype share_password: str - :keyword resource_group_id: Resource Group Id of the compute disks. Required. - :paramtype resource_group_id: str - :keyword staging_storage_account_id: Resource Id of the storage account that can be used to - copy the vhd for staging. Required. - :paramtype staging_storage_account_id: str - """ - super().__init__(share_password=share_password, **kwargs) - self.data_account_type: str = "ManagedDisk" - self.resource_group_id = resource_group_id - self.staging_storage_account_id = staging_storage_account_id - - -class MarkDevicesShippedRequest(_serialization.Model): - """The request body to provide the delivery package details of job. - - All required parameters must be populated in order to send to server. - - :ivar deliver_to_dc_package_details: Delivery package details. Required. - :vartype deliver_to_dc_package_details: ~azure.mgmt.databox.models.PackageCarrierInfo - """ - - _validation = { - "deliver_to_dc_package_details": {"required": True}, - } - - _attribute_map = { - "deliver_to_dc_package_details": {"key": "deliverToDcPackageDetails", "type": "PackageCarrierInfo"}, - } - - def __init__(self, *, deliver_to_dc_package_details: "_models.PackageCarrierInfo", **kwargs: Any) -> None: - """ - :keyword deliver_to_dc_package_details: Delivery package details. Required. - :paramtype deliver_to_dc_package_details: ~azure.mgmt.databox.models.PackageCarrierInfo - """ - super().__init__(**kwargs) - self.deliver_to_dc_package_details = deliver_to_dc_package_details - - -class MitigateJobRequest(_serialization.Model): - """The Mitigate Job captured from request body for Mitigate API. - - :ivar customer_resolution_code: Resolution code for the job. Known values are: "None", - "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". - :vartype customer_resolution_code: str or ~azure.mgmt.databox.models.CustomerResolutionCode - :ivar serial_number_customer_resolution_map: Serial number and the customer resolution code - corresponding to each serial number. - :vartype serial_number_customer_resolution_map: dict[str, str or - ~azure.mgmt.databox.models.CustomerResolutionCode] - """ - - _attribute_map = { - "customer_resolution_code": {"key": "customerResolutionCode", "type": "str"}, - "serial_number_customer_resolution_map": {"key": "serialNumberCustomerResolutionMap", "type": "{str}"}, - } - - def __init__( - self, - *, - customer_resolution_code: Optional[Union[str, "_models.CustomerResolutionCode"]] = None, - serial_number_customer_resolution_map: Optional[Dict[str, Union[str, "_models.CustomerResolutionCode"]]] = None, - **kwargs: Any - ) -> None: - """ - :keyword customer_resolution_code: Resolution code for the job. Known values are: "None", - "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". - :paramtype customer_resolution_code: str or ~azure.mgmt.databox.models.CustomerResolutionCode - :keyword serial_number_customer_resolution_map: Serial number and the customer resolution code - corresponding to each serial number. - :paramtype serial_number_customer_resolution_map: dict[str, str or - ~azure.mgmt.databox.models.CustomerResolutionCode] - """ - super().__init__(**kwargs) - self.customer_resolution_code = customer_resolution_code - self.serial_number_customer_resolution_map = serial_number_customer_resolution_map - - -class NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to server. - - :ivar stage_name: Name of the stage. Required. Known values are: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Created", and - "ShippedToCustomer". - :vartype stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :ivar send_notification: Notification is required or not. - :vartype send_notification: bool - """ - - _validation = { - "stage_name": {"required": True}, - "send_notification": {"required": True}, - } - - _attribute_map = { - "stage_name": {"key": "stageName", "type": "str"}, - "send_notification": {"key": "sendNotification", "type": "bool"}, - } - - def __init__( - self, *, stage_name: Union[str, "_models.NotificationStageName"], send_notification: bool = True, **kwargs: Any - ) -> None: - """ - :keyword stage_name: Name of the stage. Required. Known values are: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Created", and - "ShippedToCustomer". - :paramtype stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :keyword send_notification: Notification is required or not. - :paramtype send_notification: bool - """ - super().__init__(**kwargs) - self.stage_name = stage_name - self.send_notification = send_notification - - -class Operation(_serialization.Model): - """Operation entity. - - 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}. - :vartype name: str - :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay - :ivar properties: Operation properties. - :vartype properties: JSON - :ivar origin: Origin of the operation. Can be : user|system|user,system. - :vartype origin: str - :ivar is_data_action: Indicates whether the operation is a data action. - :vartype is_data_action: bool - """ - - _validation = { - "name": {"readonly": True}, - "display": {"readonly": True}, - "properties": {"readonly": True}, - "origin": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "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, *, is_data_action: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword is_data_action: Indicates whether the operation is a data action. - :paramtype is_data_action: bool - """ - super().__init__(**kwargs) - self.name = None - self.display = None - self.properties = None - self.origin = None - self.is_data_action = is_data_action - - -class OperationDisplay(_serialization.Model): - """Operation display. - - :ivar provider: Provider name. - :vartype provider: str - :ivar resource: Resource name. - :vartype resource: str - :ivar operation: Localized name of the operation for display purpose. - :vartype operation: str - :ivar description: Localized description of the operation for display purpose. - :vartype description: str - """ - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__( - self, - *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword provider: Provider name. - :paramtype provider: str - :keyword resource: Resource name. - :paramtype resource: str - :keyword operation: Localized name of the operation for display purpose. - :paramtype operation: str - :keyword description: Localized description of the operation for display purpose. - :paramtype description: str - """ - super().__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class OperationList(_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[~azure.mgmt.databox.models.Operation] - :ivar next_link: Link for the next set of operations. - :vartype 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: Any) -> None: - """ - :keyword next_link: Link for the next set of operations. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class PackageCarrierDetails(_serialization.Model): - """Package carrier details. - - :ivar carrier_account_number: Carrier Account Number of customer for customer disk. - :vartype carrier_account_number: str - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar tracking_id: Tracking Id of shipment. - :vartype tracking_id: str - """ - - _attribute_map = { - "carrier_account_number": {"key": "carrierAccountNumber", "type": "str"}, - "carrier_name": {"key": "carrierName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - } - - def __init__( - self, - *, - carrier_account_number: Optional[str] = None, - carrier_name: Optional[str] = None, - tracking_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword carrier_account_number: Carrier Account Number of customer for customer disk. - :paramtype carrier_account_number: str - :keyword carrier_name: Name of the carrier. - :paramtype carrier_name: str - :keyword tracking_id: Tracking Id of shipment. - :paramtype tracking_id: str - """ - super().__init__(**kwargs) - self.carrier_account_number = carrier_account_number - self.carrier_name = carrier_name - self.tracking_id = tracking_id - - -class PackageCarrierInfo(_serialization.Model): - """package carrier info. - - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar tracking_id: Tracking Id of shipment. - :vartype tracking_id: str - """ - - _attribute_map = { - "carrier_name": {"key": "carrierName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - } - - def __init__(self, *, carrier_name: Optional[str] = None, tracking_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword carrier_name: Name of the carrier. - :paramtype carrier_name: str - :keyword tracking_id: Tracking Id of shipment. - :paramtype tracking_id: str - """ - super().__init__(**kwargs) - self.carrier_name = carrier_name - self.tracking_id = tracking_id - - -class PackageShippingDetails(_serialization.Model): - """package shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tracking_url: Url where shipment can be tracked. - :vartype tracking_url: str - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar tracking_id: Tracking Id of shipment. - :vartype tracking_id: str - """ - - _validation = { - "tracking_url": {"readonly": True}, - "carrier_name": {"readonly": True}, - "tracking_id": {"readonly": True}, - } - - _attribute_map = { - "tracking_url": {"key": "trackingUrl", "type": "str"}, - "carrier_name": {"key": "carrierName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.tracking_url = None - self.carrier_name = None - self.tracking_id = None - - -class Preferences(_serialization.Model): - """Preferences related to the order. - - :ivar preferred_data_center_region: Preferred data center region. - :vartype preferred_data_center_region: list[str] - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - :ivar reverse_transport_preferences: Optional Preferences related to the reverse shipment - logistics of the sku. - :vartype reverse_transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: ~azure.mgmt.databox.models.EncryptionPreferences - :ivar storage_account_access_tier_preferences: Preferences related to the Access Tier of - storage accounts. - :vartype storage_account_access_tier_preferences: list[str] - """ - - _attribute_map = { - "preferred_data_center_region": {"key": "preferredDataCenterRegion", "type": "[str]"}, - "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, - "reverse_transport_preferences": {"key": "reverseTransportPreferences", "type": "TransportPreferences"}, - "encryption_preferences": {"key": "encryptionPreferences", "type": "EncryptionPreferences"}, - "storage_account_access_tier_preferences": {"key": "storageAccountAccessTierPreferences", "type": "[str]"}, - } - - def __init__( - self, - *, - preferred_data_center_region: Optional[List[str]] = None, - transport_preferences: Optional["_models.TransportPreferences"] = None, - reverse_transport_preferences: Optional["_models.TransportPreferences"] = None, - encryption_preferences: Optional["_models.EncryptionPreferences"] = None, - storage_account_access_tier_preferences: Optional[List[Literal["Archive"]]] = None, - **kwargs: Any - ) -> None: - """ - :keyword preferred_data_center_region: Preferred data center region. - :paramtype preferred_data_center_region: list[str] - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - :keyword reverse_transport_preferences: Optional Preferences related to the reverse shipment - logistics of the sku. - :paramtype reverse_transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: ~azure.mgmt.databox.models.EncryptionPreferences - :keyword storage_account_access_tier_preferences: Preferences related to the Access Tier of - storage accounts. - :paramtype storage_account_access_tier_preferences: list[str] - """ - super().__init__(**kwargs) - self.preferred_data_center_region = preferred_data_center_region - self.transport_preferences = transport_preferences - self.reverse_transport_preferences = reverse_transport_preferences - self.encryption_preferences = encryption_preferences - self.storage_account_access_tier_preferences = storage_account_access_tier_preferences - - -class PreferencesValidationRequest(ValidationInputRequest): - """Request to validate preference of transport and data center. - - All required parameters must be populated in order to send to server. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar preference: Preference of transport and data center. - :vartype preference: ~azure.mgmt.databox.models.Preferences - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "preference": {"key": "preference", "type": "Preferences"}, - "device_type": {"key": "deviceType", "type": "str"}, - "model": {"key": "model", "type": "str"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - preference: Optional["_models.Preferences"] = None, - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: Preference of transport and data center. - :paramtype preference: ~azure.mgmt.databox.models.Preferences - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype device_type: str or ~azure.mgmt.databox.models.SkuName - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.preference = preference - self.device_type = device_type - self.model = model - - -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. - - All required parameters must be populated in order to send to server. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Validation status of requested data center and transport. Known values are: - "Valid", "Invalid", and "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - "validation_type": {"required": True}, - "error": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "error": {"key": "error", "type": "CloudError"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.status = None - - -class RegionConfigurationRequest(_serialization.Model): - """Request body to get the configuration for the region. - - :ivar schedule_availability_request: Request body to get the availability for scheduling - orders. - :vartype schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :ivar transport_availability_request: Request body to get the transport availability for given - sku. - :vartype transport_availability_request: - ~azure.mgmt.databox.models.TransportAvailabilityRequest - :ivar datacenter_address_request: Request body to get the datacenter address for given sku. - :vartype datacenter_address_request: ~azure.mgmt.databox.models.DatacenterAddressRequest - :ivar device_capability_request: Request body to get the device capabilities for a given sku. - :vartype device_capability_request: ~azure.mgmt.databox.models.DeviceCapabilityRequest - """ - - _attribute_map = { - "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, - "transport_availability_request": { - "key": "transportAvailabilityRequest", - "type": "TransportAvailabilityRequest", - }, - "datacenter_address_request": {"key": "datacenterAddressRequest", "type": "DatacenterAddressRequest"}, - "device_capability_request": {"key": "deviceCapabilityRequest", "type": "DeviceCapabilityRequest"}, - } - - def __init__( - self, - *, - schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, - datacenter_address_request: Optional["_models.DatacenterAddressRequest"] = None, - device_capability_request: Optional["_models.DeviceCapabilityRequest"] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_availability_request: Request body to get the availability for scheduling - orders. - :paramtype schedule_availability_request: - ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :keyword transport_availability_request: Request body to get the transport availability for - given sku. - :paramtype transport_availability_request: - ~azure.mgmt.databox.models.TransportAvailabilityRequest - :keyword datacenter_address_request: Request body to get the datacenter address for given sku. - :paramtype datacenter_address_request: ~azure.mgmt.databox.models.DatacenterAddressRequest - :keyword device_capability_request: Request body to get the device capabilities for a given - sku. - :paramtype device_capability_request: ~azure.mgmt.databox.models.DeviceCapabilityRequest - """ - super().__init__(**kwargs) - self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_request - self.datacenter_address_request = datacenter_address_request - self.device_capability_request = device_capability_request - - -class RegionConfigurationResponse(_serialization.Model): - """Configuration response specific to a region. - - 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. - :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse - :ivar datacenter_address_response: Datacenter address for given sku in a region. - :vartype datacenter_address_response: ~azure.mgmt.databox.models.DatacenterAddressResponse - :ivar device_capability_response: Device capabilities available for a given sku in a region. - :vartype device_capability_response: ~azure.mgmt.databox.models.DeviceCapabilityResponse - """ - - _validation = { - "schedule_availability_response": {"readonly": True}, - "transport_availability_response": {"readonly": True}, - "datacenter_address_response": {"readonly": True}, - "device_capability_response": {"readonly": True}, - } - - _attribute_map = { - "schedule_availability_response": { - "key": "scheduleAvailabilityResponse", - "type": "ScheduleAvailabilityResponse", - }, - "transport_availability_response": { - "key": "transportAvailabilityResponse", - "type": "TransportAvailabilityResponse", - }, - "datacenter_address_response": {"key": "datacenterAddressResponse", "type": "DatacenterAddressResponse"}, - "device_capability_response": {"key": "deviceCapabilityResponse", "type": "DeviceCapabilityResponse"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_response = None - self.datacenter_address_response = None - self.device_capability_response = None - - -class ResourceIdentity(_serialization.Model): - """Msi identity details of the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: Identity type. - :vartype 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 - :ivar user_assigned_identities: User Assigned Identities. - :vartype user_assigned_identities: dict[str, ~azure.mgmt.databox.models.UserAssignedIdentity] - """ - - _validation = { - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "principal_id": {"key": "principalId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, - } - - def __init__( - self, - *, - type: str = "None", - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword type: Identity type. - :paramtype type: str - :keyword user_assigned_identities: User Assigned Identities. - :paramtype user_assigned_identities: dict[str, ~azure.mgmt.databox.models.UserAssignedIdentity] - """ - super().__init__(**kwargs) - self.type = type - self.principal_id = None - self.tenant_id = None - self.user_assigned_identities = user_assigned_identities - - -class ReverseShippingDetails(_serialization.Model): - """Reverse Shipping Address and contact details for a job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar contact_details: Contact Info. - :vartype contact_details: ~azure.mgmt.databox.models.ContactInfo - :ivar shipping_address: Shipping address where customer wishes to receive the device. - :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar is_updated: A flag to indicate whether Reverse Shipping details are updated or not after - device has been prepared. - Read only field. - :vartype is_updated: bool - """ - - _validation = { - "is_updated": {"readonly": True}, - } - - _attribute_map = { - "contact_details": {"key": "contactDetails", "type": "ContactInfo"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "is_updated": {"key": "isUpdated", "type": "bool"}, - } - - def __init__( - self, - *, - contact_details: Optional["_models.ContactInfo"] = None, - shipping_address: Optional["_models.ShippingAddress"] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact Info. - :paramtype contact_details: ~azure.mgmt.databox.models.ContactInfo - :keyword shipping_address: Shipping address where customer wishes to receive the device. - :paramtype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - """ - super().__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address - self.is_updated = None - - -class ScheduleAvailabilityResponse(_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. - - :ivar available_dates: List of dates available to schedule. - :vartype available_dates: list[~datetime.datetime] - """ - - _validation = { - "available_dates": {"readonly": True}, - } - - _attribute_map = { - "available_dates": {"key": "availableDates", "type": "[iso-8601]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.available_dates = None - - -class ShareCredentialDetails(_serialization.Model): - """Credential details of the shares in account. - - 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. Known values are: "UnknownType", "HCS", "BlockBlob", - "PageBlob", "AzureFile", and "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.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. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] - """ - - _validation = { - "share_name": {"readonly": True}, - "share_type": {"readonly": True}, - "user_name": {"readonly": True}, - "password": {"readonly": True}, - "supported_access_protocols": {"readonly": True}, - } - - _attribute_map = { - "share_name": {"key": "shareName", "type": "str"}, - "share_type": {"key": "shareType", "type": "str"}, - "user_name": {"key": "userName", "type": "str"}, - "password": {"key": "password", "type": "str"}, - "supported_access_protocols": {"key": "supportedAccessProtocols", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.share_name = None - self.share_type = None - self.user_name = None - self.password = None - self.supported_access_protocols = None - - -class ShipmentPickUpRequest(_serialization.Model): - """Shipment pick up request details. - - All required parameters must be populated in order to send to server. - - :ivar start_time: Minimum date after which the pick up should commence, this must be in local - time of pick up area. Required. - :vartype start_time: ~datetime.datetime - :ivar end_time: Maximum date before which the pick up should commence, this must be in local - time of pick up area. Required. - :vartype end_time: ~datetime.datetime - :ivar shipment_location: Shipment Location in the pickup place. Eg.front desk. Required. - :vartype shipment_location: str - """ - - _validation = { - "start_time": {"required": True}, - "end_time": {"required": True}, - "shipment_location": {"required": True}, - } - - _attribute_map = { - "start_time": {"key": "startTime", "type": "iso-8601"}, - "end_time": {"key": "endTime", "type": "iso-8601"}, - "shipment_location": {"key": "shipmentLocation", "type": "str"}, - } - - def __init__( - self, *, start_time: datetime.datetime, end_time: datetime.datetime, shipment_location: str, **kwargs: Any - ) -> None: - """ - :keyword start_time: Minimum date after which the pick up should commence, this must be in - local time of pick up area. Required. - :paramtype start_time: ~datetime.datetime - :keyword end_time: Maximum date before which the pick up should commence, this must be in local - time of pick up area. Required. - :paramtype end_time: ~datetime.datetime - :keyword shipment_location: Shipment Location in the pickup place. Eg.front desk. Required. - :paramtype shipment_location: str - """ - super().__init__(**kwargs) - self.start_time = start_time - self.end_time = end_time - self.shipment_location = shipment_location - - -class ShipmentPickUpResponse(_serialization.Model): - """Shipment pick up response. - - 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.datetime - """ - - _validation = { - "confirmation_number": {"readonly": True}, - "ready_by_time": {"readonly": True}, - } - - _attribute_map = { - "confirmation_number": {"key": "confirmationNumber", "type": "str"}, - "ready_by_time": {"key": "readyByTime", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.confirmation_number = None - self.ready_by_time = None - - -class ShippingAddress(_serialization.Model): - """Shipping address where customer wishes to receive the device. - - All required parameters must be populated in order to send to server. - - :ivar street_address1: Street Address line 1. Required. - :vartype street_address1: str - :ivar street_address2: Street Address line 2. - :vartype street_address2: str - :ivar street_address3: Street Address line 3. - :vartype street_address3: str - :ivar city: Name of the City. - :vartype city: str - :ivar state_or_province: Name of the State or Province. - :vartype state_or_province: str - :ivar country: Name of the Country. Required. - :vartype country: str - :ivar postal_code: Postal code. - :vartype postal_code: str - :ivar zip_extended_code: Extended Zip Code. - :vartype zip_extended_code: str - :ivar company_name: Name of the company. - :vartype company_name: str - :ivar address_type: Type of address. Known values are: "None", "Residential", and "Commercial". - :vartype address_type: str or ~azure.mgmt.databox.models.AddressType - :ivar skip_address_validation: Flag to indicate if customer has chosen to skip default address - validation. - :vartype skip_address_validation: bool - :ivar tax_identification_number: Tax Identification Number. - :vartype tax_identification_number: str - """ - - _validation = { - "street_address1": {"required": True}, - "country": {"required": True}, - } - - _attribute_map = { - "street_address1": {"key": "streetAddress1", "type": "str"}, - "street_address2": {"key": "streetAddress2", "type": "str"}, - "street_address3": {"key": "streetAddress3", "type": "str"}, - "city": {"key": "city", "type": "str"}, - "state_or_province": {"key": "stateOrProvince", "type": "str"}, - "country": {"key": "country", "type": "str"}, - "postal_code": {"key": "postalCode", "type": "str"}, - "zip_extended_code": {"key": "zipExtendedCode", "type": "str"}, - "company_name": {"key": "companyName", "type": "str"}, - "address_type": {"key": "addressType", "type": "str"}, - "skip_address_validation": {"key": "skipAddressValidation", "type": "bool"}, - "tax_identification_number": {"key": "taxIdentificationNumber", "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: Union[str, "_models.AddressType"] = "None", - skip_address_validation: Optional[bool] = None, - tax_identification_number: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword street_address1: Street Address line 1. Required. - :paramtype street_address1: str - :keyword street_address2: Street Address line 2. - :paramtype street_address2: str - :keyword street_address3: Street Address line 3. - :paramtype street_address3: str - :keyword city: Name of the City. - :paramtype city: str - :keyword state_or_province: Name of the State or Province. - :paramtype state_or_province: str - :keyword country: Name of the Country. Required. - :paramtype country: str - :keyword postal_code: Postal code. - :paramtype postal_code: str - :keyword zip_extended_code: Extended Zip Code. - :paramtype zip_extended_code: str - :keyword company_name: Name of the company. - :paramtype company_name: str - :keyword address_type: Type of address. Known values are: "None", "Residential", and - "Commercial". - :paramtype address_type: str or ~azure.mgmt.databox.models.AddressType - :keyword skip_address_validation: Flag to indicate if customer has chosen to skip default - address validation. - :paramtype skip_address_validation: bool - :keyword tax_identification_number: Tax Identification Number. - :paramtype tax_identification_number: str - """ - super().__init__(**kwargs) - self.street_address1 = street_address1 - self.street_address2 = street_address2 - self.street_address3 = street_address3 - self.city = city - self.state_or_province = state_or_province - self.country = country - self.postal_code = postal_code - self.zip_extended_code = zip_extended_code - self.company_name = company_name - self.address_type = address_type - self.skip_address_validation = skip_address_validation - self.tax_identification_number = tax_identification_number - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to server. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", - and "DataBoxCustomerDisk". - :vartype name: str or ~azure.mgmt.databox.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - "model": {"key": "model", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = None, - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype name: str or ~azure.mgmt.databox.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - self.model = model - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to server. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar country: ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. Required. - :vartype country: str - :ivar location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :vartype location: str - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - "transfer_type": {"required": True}, - "country": {"required": True}, - "location": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - "transfer_type": {"key": "transferType", "type": "str"}, - "country": {"key": "country", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "model": {"key": "model", "type": "str"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - transfer_type: Union[str, "_models.TransferType"], - country: str, - location: str, - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype device_type: str or ~azure.mgmt.databox.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :keyword country: ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. Required. - :paramtype country: str - :keyword location: Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - Required. - :paramtype location: str - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.device_type = device_type - self.transfer_type = transfer_type - self.country = country - self.location = location - self.model = model - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): # pylint: disable=name-too-long - """Properties of sku availability validation response. - - 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 server. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - "validation_type": {"required": True}, - "error": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "error": {"key": "error", "type": "CloudError"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.status = None - - -class SkuCapacity(_serialization.Model): - """Capacity of the sku. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar usable: Usable capacity in TB. - :vartype usable: str - :ivar maximum: Maximum capacity in TB. - :vartype maximum: str - :ivar individual_sku_usable: Maximum capacity per device in TB. - :vartype individual_sku_usable: str - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - "individual_sku_usable": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - "individual_sku_usable": {"key": "individualSkuUsable", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = None - self.individual_sku_usable = None - - -class SkuCost(_serialization.Model): - """Describes metadata for retrieving price info. - - 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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.meter_id = None - self.meter_type = None - self.multiplier = None - - -class SkuInformation(_serialization.Model): - """Information of the sku. - - 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 - :ivar enabled: The sku is enabled or not. - :vartype enabled: bool - :ivar data_location_to_service_location_map: The map of data location to service location. - :vartype data_location_to_service_location_map: - list[~azure.mgmt.databox.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.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. Known values are: "None", "Country", - "Region", "Feature", "OfferType", and "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.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. - :vartype required_feature: str - :ivar countries_within_commerce_boundary: List of all the Countries in the SKU specific - commerce boundary. - :vartype countries_within_commerce_boundary: list[str] - """ - - _validation = { - "sku": {"readonly": True}, - "enabled": {"readonly": True}, - "data_location_to_service_location_map": {"readonly": True}, - "capacity": {"readonly": True}, - "costs": {"readonly": True}, - "api_versions": {"readonly": True}, - "disabled_reason": {"readonly": True}, - "disabled_reason_message": {"readonly": True}, - "required_feature": {"readonly": True}, - "countries_within_commerce_boundary": {"readonly": True}, - } - - _attribute_map = { - "sku": {"key": "sku", "type": "Sku"}, - "enabled": {"key": "enabled", "type": "bool"}, - "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": "str"}, - "disabled_reason_message": {"key": "properties.disabledReasonMessage", "type": "str"}, - "required_feature": {"key": "properties.requiredFeature", "type": "str"}, - "countries_within_commerce_boundary": {"key": "properties.countriesWithinCommerceBoundary", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.sku = None - self.enabled = None - self.data_location_to_service_location_map = None - self.capacity = None - self.costs = None - self.api_versions = None - self.disabled_reason = None - self.disabled_reason_message = None - self.required_feature = None - self.countries_within_commerce_boundary = None - - -class StorageAccountDetails(DataAccountDetails): - """Details for the storage account. - - All required parameters must be populated in order to send to server. - - :ivar data_account_type: Account Type of the data to be transferred. Required. Known values - are: "StorageAccount" and "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar 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 : @#-$%^!+=;:_()]+. - :vartype share_password: str - :ivar storage_account_id: Storage Account Resource Id. Required. - :vartype 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: Any) -> None: - """ - :keyword 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 : @#-$%^!+=;:_()]+. - :paramtype share_password: str - :keyword storage_account_id: Storage Account Resource Id. Required. - :paramtype storage_account_id: str - """ - super().__init__(share_password=share_password, **kwargs) - self.data_account_type: str = "StorageAccount" - self.storage_account_id = storage_account_id - - -class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): # pylint: disable=name-too-long - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to server. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - """ - - _validation = { - "validation_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSubscriptionIsAllowedToCreateJob" - - -class SubscriptionIsAllowedToCreateJobValidationResponseProperties( - ValidationInputResponse -): # pylint: disable=name-too-long - """Properties of subscription permission to create job validation response. - - 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 server. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Validation status of subscription permission to create job. Known values are: - "Valid", "Invalid", and "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - "validation_type": {"required": True}, - "error": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "error": {"key": "error", "type": "CloudError"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSubscriptionIsAllowedToCreateJob" - self.status = None - - -class SystemData(_serialization.Model): - """Provides details about resource creation and update time. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar created_by: A string identifier for the identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource: user, application, - managedIdentity. - :vartype created_by_type: str - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: A string identifier for the identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource: user, - application, managedIdentity. - :vartype last_modified_by_type: str - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _validation = { - "created_by": {"readonly": True}, - "created_by_type": {"readonly": True}, - "created_at": {"readonly": True}, - "last_modified_by": {"readonly": True}, - "last_modified_by_type": {"readonly": True}, - "last_modified_at": {"readonly": True}, - } - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.created_by = None - self.created_by_type = None - self.created_at = None - self.last_modified_by = None - self.last_modified_by_type = None - self.last_modified_at = None - - -class TransferAllDetails(_serialization.Model): - """Details to transfer all data. - - All required parameters must be populated in order to send to server. - - :ivar data_account_type: Type of the account of data. Required. Known values are: - "StorageAccount" and "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar transfer_all_blobs: To indicate if all Azure blobs have to be transferred. - :vartype transfer_all_blobs: bool - :ivar transfer_all_files: To indicate if all Azure Files have to be transferred. - :vartype transfer_all_files: bool - """ - - _validation = { - "data_account_type": {"required": True}, - } - - _attribute_map = { - "data_account_type": {"key": "dataAccountType", "type": "str"}, - "transfer_all_blobs": {"key": "transferAllBlobs", "type": "bool"}, - "transfer_all_files": {"key": "transferAllFiles", "type": "bool"}, - } - - def __init__( - self, - *, - data_account_type: Union[str, "_models.DataAccountType"], - transfer_all_blobs: Optional[bool] = None, - transfer_all_files: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword data_account_type: Type of the account of data. Required. Known values are: - "StorageAccount" and "ManagedDisk". - :paramtype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :keyword transfer_all_blobs: To indicate if all Azure blobs have to be transferred. - :paramtype transfer_all_blobs: bool - :keyword transfer_all_files: To indicate if all Azure Files have to be transferred. - :paramtype transfer_all_files: bool - """ - super().__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(_serialization.Model): - """Configuration for defining the transfer of data. - - All required parameters must be populated in order to send to server. - - :ivar transfer_configuration_type: Type of the configuration for transfer. Required. Known - values are: "TransferAll" and "TransferUsingFilter". - :vartype transfer_configuration_type: str or - ~azure.mgmt.databox.models.TransferConfigurationType - :ivar transfer_filter_details: Map of filter type and the details to filter. This field is - required only if the TransferConfigurationType is given as TransferUsingFilter. - :vartype transfer_filter_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails - :ivar 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. - :vartype transfer_all_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails - """ - - _validation = { - "transfer_configuration_type": {"required": True}, - } - - _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, "_models.TransferConfigurationType"], - transfer_filter_details: Optional["_models.TransferConfigurationTransferFilterDetails"] = None, - transfer_all_details: Optional["_models.TransferConfigurationTransferAllDetails"] = None, - **kwargs: Any - ) -> None: - """ - :keyword transfer_configuration_type: Type of the configuration for transfer. Required. Known - values are: "TransferAll" and "TransferUsingFilter". - :paramtype transfer_configuration_type: str or - ~azure.mgmt.databox.models.TransferConfigurationType - :keyword transfer_filter_details: Map of filter type and the details to filter. This field is - required only if the TransferConfigurationType is given as TransferUsingFilter. - :paramtype transfer_filter_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails - :keyword 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. - :paramtype transfer_all_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails - """ - super().__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(_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. - - :ivar include: Details to transfer all data. - :vartype include: ~azure.mgmt.databox.models.TransferAllDetails - """ - - _attribute_map = { - "include": {"key": "include", "type": "TransferAllDetails"}, - } - - def __init__(self, *, include: Optional["_models.TransferAllDetails"] = None, **kwargs: Any) -> None: - """ - :keyword include: Details to transfer all data. - :paramtype include: ~azure.mgmt.databox.models.TransferAllDetails - """ - super().__init__(**kwargs) - self.include = include - - -class TransferConfigurationTransferFilterDetails(_serialization.Model): # pylint: disable=name-too-long - """Map of filter type and the details to filter. This field is required only if the - TransferConfigurationType is given as TransferUsingFilter. - - :ivar include: Details of the filtering the transfer of data. - :vartype include: ~azure.mgmt.databox.models.TransferFilterDetails - """ - - _attribute_map = { - "include": {"key": "include", "type": "TransferFilterDetails"}, - } - - def __init__(self, *, include: Optional["_models.TransferFilterDetails"] = None, **kwargs: Any) -> None: - """ - :keyword include: Details of the filtering the transfer of data. - :paramtype include: ~azure.mgmt.databox.models.TransferFilterDetails - """ - super().__init__(**kwargs) - self.include = include - - -class TransferFilterDetails(_serialization.Model): - """Details of the filtering the transfer of data. - - All required parameters must be populated in order to send to server. - - :ivar data_account_type: Type of the account of data. Required. Known values are: - "StorageAccount" and "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar blob_filter_details: Filter details to transfer blobs. - :vartype blob_filter_details: ~azure.mgmt.databox.models.BlobFilterDetails - :ivar azure_file_filter_details: Filter details to transfer Azure files. - :vartype azure_file_filter_details: ~azure.mgmt.databox.models.AzureFileFilterDetails - :ivar filter_file_details: Details of the filter files to be used for data transfer. - :vartype filter_file_details: list[~azure.mgmt.databox.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, "_models.DataAccountType"], - blob_filter_details: Optional["_models.BlobFilterDetails"] = None, - azure_file_filter_details: Optional["_models.AzureFileFilterDetails"] = None, - filter_file_details: Optional[List["_models.FilterFileDetails"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword data_account_type: Type of the account of data. Required. Known values are: - "StorageAccount" and "ManagedDisk". - :paramtype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :keyword blob_filter_details: Filter details to transfer blobs. - :paramtype blob_filter_details: ~azure.mgmt.databox.models.BlobFilterDetails - :keyword azure_file_filter_details: Filter details to transfer Azure files. - :paramtype azure_file_filter_details: ~azure.mgmt.databox.models.AzureFileFilterDetails - :keyword filter_file_details: Details of the filter files to be used for data transfer. - :paramtype filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] - """ - super().__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(_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. Known values are: - "CustomerManaged" and "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes - """ - - _validation = { - "shipment_type": {"readonly": True}, - } - - _attribute_map = { - "shipment_type": {"key": "shipmentType", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.shipment_type = None - - -class TransportAvailabilityRequest(_serialization.Model): - """Request body to get the transport availability for given sku. - - :ivar sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", - and "DataBoxCustomerDisk". - :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - "model": {"key": "model", "type": "str"}, - } - - def __init__( - self, - *, - sku_name: Optional[Union[str, "_models.SkuName"]] = None, - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype sku_name: str or ~azure.mgmt.databox.models.SkuName - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - self.model = model - - -class TransportAvailabilityResponse(_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. - - :ivar transport_availability_details: List of transport availability details for given region. - :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] - """ - - _validation = { - "transport_availability_details": {"readonly": True}, - } - - _attribute_map = { - "transport_availability_details": { - "key": "transportAvailabilityDetails", - "type": "[TransportAvailabilityDetails]", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.transport_availability_details = None - - -class TransportPreferences(_serialization.Model): - """Preferences related to the shipment logistics of the sku. - - 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 server. - - :ivar preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. - Required. Known values are: "CustomerManaged" and "MicrosoftManaged". - :vartype preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes - :ivar is_updated: Read only property which indicates whether transport preferences has been - updated or not after device is prepared. - :vartype is_updated: bool - """ - - _validation = { - "preferred_shipment_type": {"required": True}, - "is_updated": {"readonly": True}, - } - - _attribute_map = { - "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, - "is_updated": {"key": "isUpdated", "type": "bool"}, - } - - def __init__(self, *, preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"], **kwargs: Any) -> None: - """ - :keyword preferred_shipment_type: Indicates Shipment Logistics type that the customer - preferred. Required. Known values are: "CustomerManaged" and "MicrosoftManaged". - :paramtype preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type - self.is_updated = None - - -class UnencryptedCredentials(_serialization.Model): - """Unencrypted credentials for accessing device. - - 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 - """ - - _validation = { - "job_name": {"readonly": True}, - "job_secrets": {"readonly": True}, - } - - _attribute_map = { - "job_name": {"key": "jobName", "type": "str"}, - "job_secrets": {"key": "jobSecrets", "type": "JobSecrets"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.job_name = None - self.job_secrets = None - - -class UnencryptedCredentialsList(_serialization.Model): - """List of unencrypted credentials for accessing device. - - :ivar value: List of unencrypted credentials. - :vartype value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :ivar next_link: Link for the next set of unencrypted credentials. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[UnencryptedCredentials]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.UnencryptedCredentials"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: List of unencrypted credentials. - :paramtype value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :keyword next_link: Link for the next set of unencrypted credentials. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class UpdateJobDetails(_serialization.Model): - """Job details for update. - - :ivar contact_details: Contact details for notification and shipping. - :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar reverse_shipping_details: Reverse Shipping Address and contact details for a job. - :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :ivar preferences: Preferences related to the order. - :vartype preferences: ~azure.mgmt.databox.models.Preferences - :ivar key_encryption_key: Key encryption key for the job. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :ivar return_to_customer_package_details: Return package details of job. - :vartype return_to_customer_package_details: ~azure.mgmt.databox.models.PackageCarrierDetails - """ - - _attribute_map = { - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "reverse_shipping_details": {"key": "reverseShippingDetails", "type": "ReverseShippingDetails"}, - "preferences": {"key": "preferences", "type": "Preferences"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "return_to_customer_package_details": { - "key": "returnToCustomerPackageDetails", - "type": "PackageCarrierDetails", - }, - } - - def __init__( - self, - *, - contact_details: Optional["_models.ContactDetails"] = None, - shipping_address: Optional["_models.ShippingAddress"] = None, - reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = None, - preferences: Optional["_models.Preferences"] = None, - key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, - return_to_customer_package_details: Optional["_models.PackageCarrierDetails"] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. - :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :keyword reverse_shipping_details: Reverse Shipping Address and contact details for a job. - :paramtype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails - :keyword preferences: Preferences related to the order. - :paramtype preferences: ~azure.mgmt.databox.models.Preferences - :keyword key_encryption_key: Key encryption key for the job. - :paramtype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :keyword return_to_customer_package_details: Return package details of job. - :paramtype return_to_customer_package_details: ~azure.mgmt.databox.models.PackageCarrierDetails - """ - super().__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address - self.reverse_shipping_details = reverse_shipping_details - self.preferences = preferences - self.key_encryption_key = key_encryption_key - self.return_to_customer_package_details = return_to_customer_package_details - - -class UserAssignedIdentity(_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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserAssignedProperties(_serialization.Model): - """User assigned identity properties. - - :ivar resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. - :vartype resource_id: str - """ - - _attribute_map = { - "resource_id": {"key": "resourceId", "type": "str"}, - } - - def __init__(self, *, resource_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. - :paramtype resource_id: str - """ - super().__init__(**kwargs) - self.resource_id = resource_id - - -class ValidateAddress(ValidationInputRequest): - """The requirements to validate customer address where the device needs to be shipped. - - All required parameters must be populated in order to send to server. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", - "ValidateCreateOrderLimit", "ValidateSkuAvailability", and "ValidateDataTransferDetails". - :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - :ivar model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :vartype model: str or ~azure.mgmt.databox.models.ModelName - """ - - _validation = { - "validation_type": {"required": True}, - "shipping_address": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "device_type": {"key": "deviceType", "type": "str"}, - "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, - "model": {"key": "model", "type": "str"}, - } - - def __init__( - self, - *, - shipping_address: "_models.ShippingAddress", - device_type: Union[str, "_models.SkuName"], - transport_preferences: Optional["_models.TransportPreferences"] = None, - model: Optional[Union[str, "_models.ModelName"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype device_type: str or ~azure.mgmt.databox.models.SkuName - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - :keyword model: The customer friendly name of the combination of version and capacity of the - device. This field is necessary only at the time of ordering the newer generation device i.e. - AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". - :paramtype model: str or ~azure.mgmt.databox.models.ModelName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.shipping_address = shipping_address - self.device_type = device_type - self.transport_preferences = transport_preferences - self.model = model - - -class ValidationResponse(_serialization.Model): - """Response of pre job creation validations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar status: Overall validation status. Known values are: "AllValidToProceed", - "InputsRevisitRequired", and "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. - :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] - """ - - _validation = { - "status": {"readonly": True}, - "individual_response_details": {"readonly": True}, - } - - _attribute_map = { - "status": {"key": "properties.status", "type": "str"}, - "individual_response_details": { - "key": "properties.individualResponseDetails", - "type": "[ValidationInputResponse]", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.status = None - self.individual_response_details = None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_patch.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/__init__.py index 3e73db476be2..0e7e8ee31d19 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -13,9 +13,9 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore -from ._jobs_operations import JobsOperations # type: ignore -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin # type: ignore -from ._service_operations import ServiceOperations # type: ignore +from ._operations import JobsOperations # type: ignore +from ._operations import ServiceOperations # type: ignore +from ._operations import _DataBoxManagementClientOperationsMixin # type: ignore # pylint: disable=unused-import from ._patch import __all__ as _patch_all from ._patch import * @@ -24,7 +24,6 @@ __all__ = [ "Operations", "JobsOperations", - "DataBoxManagementClientOperationsMixin", "ServiceOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_data_box_management_client_operations.py deleted file mode 100644 index 98c72599fa32..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,203 +0,0 @@ -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import DataBoxManagementClientMixinABC - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_mitigate_request(job_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate", - ) # pylint: disable=line-too-long - path_format_arguments = { - "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC): - - @overload - def mitigate( - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: _models.MitigateJobRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Request to mitigate for a given job. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mitigate_job_request: Mitigation Request. Required. - :type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mitigate( - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Request to mitigate for a given job. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mitigate_job_request: Mitigation Request. Required. - :type mitigate_job_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO[bytes]], - **kwargs: Any - ) -> None: - """Request to mitigate for a given job. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a - IO[bytes] type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(mitigate_job_request, (IOBase, bytes)): - _content = mitigate_job_request - else: - _json = self._serialize.body(mitigate_job_request, "MitigateJobRequest") - - _request = build_mitigate_request( - job_name=job_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_jobs_operations.py deleted file mode 100644 index 6c0b997fe544..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_jobs_operations.py +++ /dev/null @@ -1,1612 +0,0 @@ -# pylint: disable=too-many-lines -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_mark_devices_shipped_request( - job_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped", - ) # pylint: disable=line-too-long - path_format_arguments = { - "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request( - resource_group_name: str, subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, job_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_request(resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request(resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, job_name: str, subscription_id: str, *, if_match: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_book_shipment_pick_up_request( - resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_request(resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_credentials_request( - resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.DataBoxManagementClient`'s - :attr:`jobs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, skip_token: Optional[str] = None, **kwargs: Any) -> Iterable["_models.JobResource"]: - """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. Default value is None. - :type skip_token: str - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - 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) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def mark_devices_shipped( - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: _models.MarkDevicesShippedRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Request to mark devices for a given job as shipped. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mark_devices_shipped_request: Mark Devices Shipped Request. Required. - :type mark_devices_shipped_request: ~azure.mgmt.databox.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mark_devices_shipped( - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Request to mark devices for a given job as shipped. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mark_devices_shipped_request: Mark Devices Shipped Request. Required. - :type mark_devices_shipped_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: Union[_models.MarkDevicesShippedRequest, IO[bytes]], - **kwargs: Any - ) -> None: - """Request to mark devices for a given job as shipped. - - :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. - Required. - :type job_name: str - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param mark_devices_shipped_request: Mark Devices Shipped Request. Is either a - MarkDevicesShippedRequest type or a IO[bytes] type. Required. - :type mark_devices_shipped_request: ~azure.mgmt.databox.models.MarkDevicesShippedRequest or - IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(mark_devices_shipped_request, (IOBase, bytes)): - _content = mark_devices_shipped_request - else: - _json = self._serialize.body(mark_devices_shipped_request, "MarkDevicesShippedRequest") - - _request = build_mark_devices_shipped_request( - job_name=job_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.JobResource"]: - """Lists all the jobs available under the given resource group. - - :param resource_group_name: The Resource Group Name. Required. - :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. Default value is None. - :type skip_token: str - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - 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) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, job_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> _models.JobResource: - """Gets information about the specified job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param expand: $expand is supported on details parameter for job, which provides details on the - job stages. Default value is None. - :type expand: str - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - job_name: str, - job_resource: Union[_models.JobResource, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IOBase, bytes)): - _content = job_resource - else: - _json = self._serialize.body(job_resource, "JobResource") - - _request = build_create_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: _models.JobResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> 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. Required. - :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. - Required. - :type job_name: str - :param job_resource: Job details from request body. Required. - :type job_resource: ~azure.mgmt.databox.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> 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. Required. - :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. - Required. - :type job_name: str - :param job_resource: Job details from request body. Required. - :type job_resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: Union[_models.JobResource, IO[bytes]], - **kwargs: Any - ) -> 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. Required. - :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. - Required. - :type job_name: str - :param job_resource: Job details from request body. Is either a JobResource type or a IO[bytes] - type. Required. - :type job_resource: ~azure.mgmt.databox.models.JobResource or IO[bytes] - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - job_name=job_name, - job_resource=job_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.JobResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JobResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :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: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - job_name=job_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IOBase, bytes)): - _content = job_resource_update_parameter - else: - _json = self._serialize.body(job_resource_update_parameter, "JobResourceUpdateParameter") - - _request = build_update_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: _models.JobResourceUpdateParameter, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JobResource]: - """Updates the properties of an existing job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param job_resource_update_parameter: Job update parameters from request body. Required. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter - :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. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO[bytes], - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JobResource]: - """Updates the properties of an existing job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param job_resource_update_parameter: Job update parameters from request body. Required. - :type job_resource_update_parameter: IO[bytes] - :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. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.JobResource]: - """Updates the properties of an existing job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param job_resource_update_parameter: Job update parameters from request body. Is either a - JobResourceUpdateParameter type or a IO[bytes] type. Required. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter or - IO[bytes] - :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. Default value is None. - :type if_match: str - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - job_name=job_name, - job_resource_update_parameter=job_resource_update_parameter, - if_match=if_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.JobResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JobResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def book_shipment_pick_up( - self, - resource_group_name: str, - job_name: str, - shipment_pick_up_request: _models.ShipmentPickUpRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ShipmentPickUpResponse: - """Book shipment pick up. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param shipment_pick_up_request: Details of shipment pick up request. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def book_shipment_pick_up( - self, - resource_group_name: str, - job_name: str, - shipment_pick_up_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ShipmentPickUpResponse: - """Book shipment pick up. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param shipment_pick_up_request: Details of shipment pick up request. Required. - :type shipment_pick_up_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def book_shipment_pick_up( - self, - resource_group_name: str, - job_name: str, - shipment_pick_up_request: Union[_models.ShipmentPickUpRequest, IO[bytes]], - **kwargs: Any - ) -> _models.ShipmentPickUpResponse: - """Book shipment pick up. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param shipment_pick_up_request: Details of shipment pick up request. Is either a - ShipmentPickUpRequest type or a IO[bytes] type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest or IO[bytes] - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ShipmentPickUpResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(shipment_pick_up_request, (IOBase, bytes)): - _content = shipment_pick_up_request - else: - _json = self._serialize.body(shipment_pick_up_request, "ShipmentPickUpRequest") - - _request = build_book_shipment_pick_up_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def cancel( - self, - resource_group_name: str, - job_name: str, - cancellation_reason: _models.CancellationReason, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """CancelJob. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """CancelJob. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO[bytes]], - **kwargs: Any - ) -> None: - """CancelJob. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO[bytes] type. Required. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cancellation_reason, (IOBase, bytes)): - _content = cancellation_reason - else: - _json = self._serialize.body(cancellation_reason, "CancellationReason") - - _request = build_cancel_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_credentials( - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> Iterable["_models.UnencryptedCredentials"]: - """This method gets the unencrypted secrets related to the job. - - :param resource_group_name: The Resource Group Name. Required. - :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. - Required. - :type job_name: str - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.UnencryptedCredentials] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_credentials_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - 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) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_operations.py index 37ea02a3ce73..15153f0afc6b 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_operations.py @@ -1,52 +1,61 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import MatchConditions, PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models -from .._serialization import Serializer +from .. import models as _models, types as _types +from .._configuration import DataBoxManagementClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from .._utils.utils import ClientMixinABC, prep_if_match, prep_if_none_match -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_list_request(**kwargs: Any) -> HttpRequest: +def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") + _url = "/providers/Microsoft.DataBox/operations" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -57,6 +66,517 @@ def build_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_jobs_get_request( + resource_group_name: str, job_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jobs_create_request( + resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jobs_update_request( + resource_group_name: str, + job_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jobs_delete_request( + resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_jobs_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jobs_list_request(subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jobs_book_shipment_pick_up_request( + resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jobs_cancel_request( + resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jobs_list_credentials_request( + resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jobs_mark_devices_shipped_request( + job_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" + path_format_arguments = { + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_region_configuration_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_validate_address_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_validate_inputs_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_list_available_skus_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_region_configuration_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_service_validate_inputs_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_data_box_management_mitigate_request( # pylint: disable=name-too-long + job_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-01")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" + path_format_arguments = { + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class Operations: """ .. warning:: @@ -64,31 +584,2272 @@ class Operations: Instead, you should access the following operations through :class:`~azure.mgmt.databox.DataBoxManagementClient`'s - :attr:`operations` attribute. + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.databox.DataBoxManagementClient`'s + :attr:`jobs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, job_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.JobResource: + """Gets information about the specified job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :keyword expand: $expand is supported on details parameter for job, which provides details on + the job stages. Default value is None. + :paramtype expand: str + :return: JobResource. The JobResource is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + + _request = build_jobs_get_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + job_name: str, + job_resource: Union[_models.JobResource, _types.JobResource, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(job_resource, (IOBase, bytes)): + _content = job_resource + else: + _content = json.dumps(job_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_create_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> 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 name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.models.JobResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns JobResource. The JobResource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _types.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> 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 name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.types.JobResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns JobResource. The JobResource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> 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 name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns JobResource. The JobResource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: Union[_models.JobResource, _types.JobResource, IO[bytes]], + **kwargs: Any + ) -> 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 name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource: Job details from request body. Is either a JobResource type or a IO[bytes] + type. Required. + :type job_resource: ~azure.mgmt.databox.models.JobResource or + ~azure.mgmt.databox.types.JobResource or IO[bytes] + :return: An instance of LROPoller that returns JobResource. The JobResource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource=job_resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JobResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: Union[ + _models.JobResourceUpdateParameter, _types.JobResourceUpdateParameter, IO[bytes] + ], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(job_resource_update_parameter, (IOBase, bytes)): + _content = job_resource_update_parameter + else: + _content = json.dumps(job_resource_update_parameter, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_update_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns JobResource. The JobResource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _types.JobResourceUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: ~azure.mgmt.databox.types.JobResourceUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns JobResource. The JobResource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns JobResource. The JobResource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: Union[ + _models.JobResourceUpdateParameter, _types.JobResourceUpdateParameter, IO[bytes] + ], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Is either a + JobResourceUpdateParameter type or a IO[bytes] type. Required. + :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter or + ~azure.mgmt.databox.types.JobResourceUpdateParameter or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns JobResource. The JobResource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource_update_parameter=job_resource_update_parameter, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JobResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_jobs_delete_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + 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, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, skip_token: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword skip_token: $skipToken is supported on Get list of jobs, which provides the next page + in the list of jobs. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of JobResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_jobs_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, *, skip_token: Optional[str] = None, **kwargs: Any) -> ItemPaged["_models.JobResource"]: + """Lists all the jobs available under the subscription. + + :keyword skip_token: $skipToken is supported on Get list of jobs, which provides the next page + in the list of jobs. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of JobResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_jobs_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ShipmentPickUpResponse. The ShipmentPickUpResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _types.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.types.ShipmentPickUpRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ShipmentPickUpResponse. The ShipmentPickUpResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ShipmentPickUpResponse. The ShipmentPickUpResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: Union[_models.ShipmentPickUpRequest, _types.ShipmentPickUpRequest, IO[bytes]], + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Is either a + ShipmentPickUpRequest type or a IO[bytes] type. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest or + ~azure.mgmt.databox.types.ShipmentPickUpRequest or IO[bytes] + :return: ShipmentPickUpResponse. The ShipmentPickUpResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ShipmentPickUpResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(shipment_pick_up_request, (IOBase, bytes)): + _content = shipment_pick_up_request + else: + _content = json.dumps(shipment_pick_up_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_book_shipment_pick_up_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ShipmentPickUpResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: _models.CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: _types.CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: ~azure.mgmt.databox.types.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def cancel( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + job_name: str, + cancellation_reason: Union[_models.CancellationReason, _types.CancellationReason, IO[bytes]], + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a + IO[bytes] type. Required. + :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason or + ~azure.mgmt.databox.types.CancellationReason or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(cancellation_reason, (IOBase, bytes)): + _content = cancellation_reason + else: + _content = json.dumps(cancellation_reason, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_cancel_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> ItemPaged["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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. + Required. + :type job_name: str + :return: An iterator like instance of UnencryptedCredentials + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.UnencryptedCredentials] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.UnencryptedCredentials]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_jobs_list_credentials_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.UnencryptedCredentials], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: _models.MarkDevicesShippedRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mark devices for a given job as shipped. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mark_devices_shipped_request: Mark Devices Shipped Request. Required. + :type mark_devices_shipped_request: ~azure.mgmt.databox.models.MarkDevicesShippedRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: _types.MarkDevicesShippedRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mark devices for a given job as shipped. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mark_devices_shipped_request: Mark Devices Shipped Request. Required. + :type mark_devices_shipped_request: ~azure.mgmt.databox.types.MarkDevicesShippedRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mark devices for a given job as shipped. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mark_devices_shipped_request: Mark Devices Shipped Request. Required. + :type mark_devices_shipped_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def mark_devices_shipped( # pylint: disable=inconsistent-return-statements + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: Union[ + _models.MarkDevicesShippedRequest, _types.MarkDevicesShippedRequest, IO[bytes] + ], + **kwargs: Any + ) -> None: + """Request to mark devices for a given job as shipped. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mark_devices_shipped_request: Mark Devices Shipped Request. Is either a + MarkDevicesShippedRequest type or a IO[bytes] type. Required. + :type mark_devices_shipped_request: ~azure.mgmt.databox.models.MarkDevicesShippedRequest or + ~azure.mgmt.databox.types.MarkDevicesShippedRequest or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(mark_devices_shipped_request, (IOBase, bytes)): + _content = mark_devices_shipped_request + else: + _content = json.dumps(mark_devices_shipped_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_mark_devices_shipped_request( + job_name=job_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ServiceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.databox.DataBoxManagementClient`'s + :attr:`service` attribute. """ - models = _models - - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: The request body. Required. + :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def region_configuration( + self, + location: str, + region_configuration_request: _types.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: The request body. Required. + :type region_configuration_request: ~azure.mgmt.databox.types.RegionConfigurationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def region_configuration( + self, + location: str, + region_configuration_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: The request body. Required. + :type region_configuration_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. + def region_configuration( + self, + location: str, + region_configuration_request: Union[ + _models.RegionConfigurationRequest, _types.RegionConfigurationRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.Operation] + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: The request body. Is either a RegionConfigurationRequest + type or a IO[bytes] type. Required. + :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or + ~azure.mgmt.databox.types.RegionConfigurationRequest or IO[bytes] + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(region_configuration_request, (IOBase, bytes)): + _content = region_configuration_request + else: + _content = json.dumps(region_configuration_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_service_region_configuration_request( + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RegionConfigurationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _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 name of the Azure region. Required. + :type location: str + :param validate_address: The request body. Required. + :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AddressValidationOutput. The AddressValidationOutput is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_address( + self, + location: str, + validate_address: _types.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _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 name of the Azure region. Required. + :type location: str + :param validate_address: The request body. Required. + :type validate_address: ~azure.mgmt.databox.types.ValidateAddress + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AddressValidationOutput. The AddressValidationOutput is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_address( + self, location: str, validate_address: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _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 name of the Azure region. Required. + :type location: str + :param validate_address: The request body. Required. + :type validate_address: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AddressValidationOutput. The AddressValidationOutput is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def validate_address( + self, + location: str, + validate_address: Union[_models.ValidateAddress, _types.ValidateAddress, IO[bytes]], + **kwargs: Any + ) -> _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 name of the Azure region. Required. + :type location: str + :param validate_address: The request body. Is either a ValidateAddress type or a IO[bytes] + type. Required. + :type validate_address: ~azure.mgmt.databox.models.ValidateAddress or + ~azure.mgmt.databox.types.ValidateAddress or IO[bytes] + :return: AddressValidationOutput. The AddressValidationOutput is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressValidationOutput] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(validate_address, (IOBase, bytes)): + _content = validate_address + else: + _content = json.dumps(validate_address, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_service_validate_address_request( + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AddressValidationOutput, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: The request body. Required. + :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_inputs( + self, + location: str, + validation_request: _types.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: The request body. Required. + :type validation_request: ~azure.mgmt.databox.types.ValidationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_inputs( + self, location: str, validation_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: The request body. Required. + :type validation_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def validate_inputs( + self, + location: str, + validation_request: Union[_models.ValidationRequest, _types.ValidationRequest, IO[bytes]], + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: The request body. Is either a ValidationRequest type or a IO[bytes] + type. Required. + :type validation_request: ~azure.mgmt.databox.models.ValidationRequest or + ~azure.mgmt.databox.types.ValidationRequest or IO[bytes] + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(validation_request, (IOBase, bytes)): + _content = validation_request + else: + _content = json.dumps(validation_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_service_validate_inputs_request( + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ValidationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: _models.AvailableSkuRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged["_models.SkuInformation"]: + """This method provides the list of available skus for the given subscription, resource group and + location. - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param available_sku_request: Filters for showing the available skus. Required. + :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of SkuInformation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: _types.AvailableSkuRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged["_models.SkuInformation"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param available_sku_request: Filters for showing the available skus. Required. + :type available_sku_request: ~azure.mgmt.databox.types.AvailableSkuRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of SkuInformation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged["_models.SkuInformation"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param available_sku_request: Filters for showing the available skus. Required. + :type available_sku_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of SkuInformation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: Union[_models.AvailableSkuRequest, _types.AvailableSkuRequest, IO[bytes]], + **kwargs: Any + ) -> ItemPaged["_models.SkuInformation"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param available_sku_request: Filters for showing the available skus. Is either a + AvailableSkuRequest type or a IO[bytes] type. Required. + :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest or + ~azure.mgmt.databox.types.AvailableSkuRequest or IO[bytes] + :return: An iterator like instance of SkuInformation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[_models.SkuInformation]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -97,16 +2858,32 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _content = None + if isinstance(available_sku_request, (IOBase, bytes)): + _content = available_sku_request + else: + _content = json.dumps(available_sku_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_service_list_available_skus_by_resource_group_request( + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -119,18 +2896,29 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SkuInformation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -143,9 +2931,539 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) + + @overload + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _types.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: ~azure.mgmt.databox.types.RegionConfigurationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: Union[ + _models.RegionConfigurationRequest, _types.RegionConfigurationRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Is either a RegionConfigurationRequest type or a IO[bytes] type. + Required. + :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or + ~azure.mgmt.databox.types.RegionConfigurationRequest or IO[bytes] + :return: RegionConfigurationResponse. The RegionConfigurationResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(region_configuration_request, (IOBase, bytes)): + _content = region_configuration_request + else: + _content = json.dumps(region_configuration_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_service_region_configuration_by_resource_group_request( + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RegionConfigurationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _types.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.types.ValidationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: Union[_models.ValidationRequest, _types.ValidationRequest, IO[bytes]], + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Inputs of the customer. Is either a ValidationRequest type or a + IO[bytes] type. Required. + :type validation_request: ~azure.mgmt.databox.models.ValidationRequest or + ~azure.mgmt.databox.types.ValidationRequest or IO[bytes] + :return: ValidationResponse. The ValidationResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.databox.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(validation_request, (IOBase, bytes)): + _content = validation_request + else: + _content = json.dumps(validation_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_service_validate_inputs_by_resource_group_request( + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ValidationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class _DataBoxManagementClientOperationsMixin( + ClientMixinABC[PipelineClient[HttpRequest, HttpResponse], DataBoxManagementClientConfiguration] +): + + @overload + def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: _models.MitigateJobRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mitigate for a given job. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. Required. + :type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: _types.MitigateJobRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mitigate for a given job. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. Required. + :type mitigate_job_request: ~azure.mgmt.databox.types.MitigateJobRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Request to mitigate for a given job. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. Required. + :type mitigate_job_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def mitigate( # pylint: disable=inconsistent-return-statements + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: Union[_models.MitigateJobRequest, _types.MitigateJobRequest, IO[bytes]], + **kwargs: Any + ) -> None: + """Request to mitigate for a given job. + + :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. + Required. + :type job_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a + IO[bytes] type. Required. + :type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest or + ~azure.mgmt.databox.types.MitigateJobRequest or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(mitigate_job_request, (IOBase, bytes)): + _content = mitigate_job_request + else: + _content = json.dumps(mitigate_job_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_box_management_mitigate_request( + job_name=job_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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 = _failsafe_deserialize( + _models.ApiError, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_patch.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_service_operations.py deleted file mode 100644 index 9e1824b973ad..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_service_operations.py +++ /dev/null @@ -1,1021 +0,0 @@ -# pylint: disable=too-many-lines -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_available_skus_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_validate_address_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_validate_inputs_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_validate_inputs_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_region_configuration_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_region_configuration_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServiceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.DataBoxManagementClient`'s - :attr:`service` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def list_available_skus_by_resource_group( - self, - resource_group_name: str, - location: str, - available_sku_request: _models.AvailableSkuRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Iterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription, resource group and - location. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param available_sku_request: Filters for showing the available skus. Required. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_available_skus_by_resource_group( - self, - resource_group_name: str, - location: str, - available_sku_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Iterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription, resource group and - location. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param available_sku_request: Filters for showing the available skus. Required. - :type available_sku_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_available_skus_by_resource_group( - self, - resource_group_name: str, - location: str, - available_sku_request: Union[_models.AvailableSkuRequest, IO[bytes]], - **kwargs: Any - ) -> Iterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription, resource group and - location. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param available_sku_request: Filters for showing the available skus. Is either a - AvailableSkuRequest type or a IO[bytes] type. Required. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest or IO[bytes] - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(available_sku_request, (IOBase, bytes)): - _content = available_sku_request - else: - _json = self._serialize.body(available_sku_request, "AvailableSkuRequest") - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_available_skus_by_resource_group_request( - resource_group_name=resource_group_name, - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AvailableSkusResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def validate_address( - self, - location: str, - validate_address: _models.ValidateAddress, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _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. Required. - :type location: str - :param validate_address: Shipping address of the customer. Required. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _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. Required. - :type location: str - :param validate_address: Shipping address of the customer. Required. - :type validate_address: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO[bytes]], **kwargs: Any - ) -> _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. Required. - :type location: str - :param validate_address: Shipping address of the customer. Is either a ValidateAddress type or - a IO[bytes] type. Required. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress or IO[bytes] - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressValidationOutput] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(validate_address, (IOBase, bytes)): - _content = validate_address - else: - _json = self._serialize.body(validate_address, "ValidateAddress") - - _request = build_validate_address_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AddressValidationOutput", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: _models.ValidationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under resource group. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Required. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under resource group. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Required. - :type validation_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: Union[_models.ValidationRequest, IO[bytes]], - **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under resource group. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Is either a ValidationRequest type or a - IO[bytes] type. Required. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest or IO[bytes] - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(validation_request, (IOBase, bytes)): - _content = validation_request - else: - _json = self._serialize.body(validation_request, "ValidationRequest") - - _request = build_validate_inputs_by_resource_group_request( - resource_group_name=resource_group_name, - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def validate_inputs( - self, - location: str, - validation_request: _models.ValidationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under subscription. - - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Required. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs( - self, location: str, validation_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under subscription. - - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Required. - :type validation_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO[bytes]], **kwargs: Any - ) -> _models.ValidationResponse: - """This method does all necessary pre-job creation validation under subscription. - - :param location: The location of the resource. Required. - :type location: str - :param validation_request: Inputs of the customer. Is either a ValidationRequest type or a - IO[bytes] type. Required. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest or IO[bytes] - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(validation_request, (IOBase, bytes)): - _content = validation_request - else: - _json = self._serialize.body(validation_request, "ValidationRequest") - - _request = build_validate_inputs_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def region_configuration( - self, - location: str, - region_configuration_request: _models.RegionConfigurationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Subscription - level. - - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region. - Required. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration( - self, - location: str, - region_configuration_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Subscription - level. - - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region. - Required. - :type region_configuration_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration( - self, - location: str, - region_configuration_request: Union[_models.RegionConfigurationRequest, IO[bytes]], - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Subscription - level. - - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region. Is - either a RegionConfigurationRequest type or a IO[bytes] type. Required. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or - IO[bytes] - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(region_configuration_request, (IOBase, bytes)): - _content = region_configuration_request - else: - _json = self._serialize.body(region_configuration_request, "RegionConfigurationRequest") - - _request = build_region_configuration_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def region_configuration_by_resource_group( - self, - resource_group_name: str, - location: str, - region_configuration_request: _models.RegionConfigurationRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Resource group - level. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region at - resource group level. Required. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration_by_resource_group( - self, - resource_group_name: str, - location: str, - region_configuration_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Resource group - level. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region at - resource group level. Required. - :type region_configuration_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration_by_resource_group( - self, - resource_group_name: str, - location: str, - region_configuration_request: Union[_models.RegionConfigurationRequest, IO[bytes]], - **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location at Resource group - level. - - :param resource_group_name: The Resource Group Name. Required. - :type resource_group_name: str - :param location: The location of the resource. Required. - :type location: str - :param region_configuration_request: Request body to get the configuration for the region at - resource group level. Is either a RegionConfigurationRequest type or a IO[bytes] type. - Required. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or - IO[bytes] - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(region_configuration_request, (IOBase, bytes)): - _content = region_configuration_request - else: - _json = self._serialize.body(region_configuration_request, "RegionConfigurationRequest") - - _request = build_region_configuration_by_resource_group_request( - resource_group_name=resource_group_name, - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ApiError, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/types.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/types.py new file mode 100644 index 000000000000..9f20cb9dcf88 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/types.py @@ -0,0 +1,3639 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Literal, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from .models._enums import ( + ClassDiscriminator, + DataAccountType, + DatacenterAddressType, + SkuName, + ValidationInputDiscriminator, +) + +if TYPE_CHECKING: + from .models import ( + AccessProtocol, + AddressType, + AddressValidationStatus, + CopyStatus, + CreatedByType, + CustomerResolutionCode, + DataAccountType, + DataCenterCode, + DelayNotificationStatus, + DoubleEncryption, + FilterFileType, + HardwareEncryption, + JobDeliveryType, + KekType, + LogCollectionLevel, + ModelName, + NotificationStageName, + OverallValidationStatus, + PortalDelayErrorCode, + ReverseShippingDetailsEditStatus, + ReverseTransportPreferenceEditStatus, + ShareDestinationFormatType, + SkuDisabledReason, + SkuName, + StageName, + StageStatus, + TransferConfigurationType, + TransferType, + TransportShipmentTypes, + ValidationStatus, + ) + + +class AccountCredentialDetails(TypedDict, total=False): + """Credential details of the account. + + :ivar account_name: Name of the account. + :vartype account_name: str + :ivar data_account_type: Type of the account. Known values are: "StorageAccount" and + "ManagedDisk". + :vartype data_account_type: Union[str, "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. + :vartype share_credential_details: list["ShareCredentialDetails"] + """ + + accountName: str + """Name of the account.""" + dataAccountType: Union[str, "DataAccountType"] + """Type of the account. Known values are: \"StorageAccount\" and \"ManagedDisk\".""" + accountConnectionString: str + """Connection string of the account endpoint to use the account as a storage endpoint on the + device.""" + shareCredentialDetails: list["ShareCredentialDetails"] + """Per share level unencrypted access credentials.""" + + +class AdditionalErrorInfo(TypedDict, total=False): + """This class represents additional info which Resource Providers pass when an error occurs. + + :ivar info: Additional information of the type of error. + :vartype info: dict[str, Any] + :ivar type: Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation). + :vartype type: str + """ + + info: dict[str, Any] + """Additional information of the type of error.""" + type: str + """Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation).""" + + +class AddressValidationOutput(TypedDict, total=False): + """Output of the address validation api. + + :ivar properties: The address validation properties. + :vartype properties: "AddressValidationProperties" + """ + + properties: "AddressValidationProperties" + """The address validation properties.""" + + +class AddressValidationProperties(TypedDict, total=False): + """The address validation output. + + :ivar error: Error code and message of validation response. + :vartype error: "CloudError" + :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", + and "Ambiguous". + :vartype validation_status: Union[str, "AddressValidationStatus"] + :ivar alternate_addresses: List of alternate addresses. + :vartype alternate_addresses: list["ShippingAddress"] + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response of address validation. + :vartype validation_type: Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS] + """ + + error: "CloudError" + """Error code and message of validation response.""" + validationStatus: Union[str, "AddressValidationStatus"] + """The address validation status. Known values are: \"Valid\", \"Invalid\", and \"Ambiguous\".""" + alternateAddresses: list["ShippingAddress"] + """List of alternate addresses.""" + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS]] + """Identifies the type of validation response. Required. Identify request and response of address + validation.""" + + +class ApiError(TypedDict, total=False): + """ApiError. + + :ivar error: The error detail. Required. + :vartype error: "ErrorDetail" + """ + + error: Required["ErrorDetail"] + """The error detail. Required.""" + + +class ApplianceNetworkConfiguration(TypedDict, total=False): + """The Network Adapter configuration of a DataBox. + + :ivar name: Name of the network. + :vartype name: str + :ivar mac_address: Mac Address. + :vartype mac_address: str + """ + + name: str + """Name of the network.""" + macAddress: str + """Mac Address.""" + + +class AvailableSkuRequest(TypedDict, total=False): + """The filters for showing the available skus. + + :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: Union[str, "TransferType"] + :ivar country: ISO country code. Country for hardware shipment. For codes check: + `https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + `_. + Required. + :vartype country: str + :ivar location: Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype location: str + :ivar sku_names: Sku Names to filter for available skus. + :vartype sku_names: list[Union[str, "SkuName"]] + """ + + transferType: Required[Union[str, "TransferType"]] + """Type of the transfer. Required. Known values are: \"ImportToAzure\" and \"ExportFromAzure\".""" + country: Required[str] + """ISO country code. Country for hardware shipment. For codes check: + `https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + `_. + Required.""" + location: Required[str] + """Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required.""" + skuNames: list[Union[str, "SkuName"]] + """Sku Names to filter for available skus.""" + + +class AzureFileFilterDetails(TypedDict, total=False): + """Filter details to transfer Azure files. + + :ivar file_prefix_list: Prefix list of the Azure files to be transferred. + :vartype file_prefix_list: list[str] + :ivar file_path_list: List of full path of the files to be transferred. + :vartype file_path_list: list[str] + :ivar file_share_list: List of file shares to be transferred. + :vartype file_share_list: list[str] + """ + + filePrefixList: list[str] + """Prefix list of the Azure files to be transferred.""" + filePathList: list[str] + """List of full path of the files to be transferred.""" + fileShareList: list[str] + """List of file shares to be transferred.""" + + +class BlobFilterDetails(TypedDict, total=False): + """Filter details to transfer Azure Blobs. + + :ivar blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :vartype blob_prefix_list: list[str] + :ivar blob_path_list: List of full path of the blobs to be transferred. + :vartype blob_path_list: list[str] + :ivar container_list: List of blob containers to be transferred. + :vartype container_list: list[str] + """ + + blobPrefixList: list[str] + """Prefix list of the Azure blobs to be transferred.""" + blobPathList: list[str] + """List of full path of the blobs to be transferred.""" + containerList: list[str] + """List of blob containers to be transferred.""" + + +class CancellationReason(TypedDict, total=False): + """Reason for cancellation. + + :ivar reason: Reason for cancellation. Required. + :vartype reason: str + """ + + reason: Required[str] + """Reason for cancellation. Required.""" + + +class CloudError(TypedDict, total=False): + """Provides additional information about an http error response. + + :ivar additional_info: Gets or sets additional error info. + :vartype additional_info: list["AdditionalErrorInfo"] + :ivar code: Error code. + :vartype code: str + :ivar details: Gets or sets details for the error. + :vartype details: list["CloudError"] + :ivar message: The error message parsed from the body of the http error response. + :vartype message: str + :ivar target: Gets or sets the target of the error. + :vartype target: str + """ + + additionalInfo: list["AdditionalErrorInfo"] + """Gets or sets additional error info.""" + code: str + """Error code.""" + details: list["CloudError"] + """Gets or sets details for the error.""" + message: str + """The error message parsed from the body of the http error response.""" + target: str + """Gets or sets the target of the error.""" + + +class ContactDetails(TypedDict, total=False): + """Contact Details. + + :ivar contact_name: Contact name of the person. Required. + :vartype contact_name: str + :ivar phone: Phone number of the contact person. Required. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + :ivar email_list: List of Email-ids to be notified about job progress. Required. + :vartype email_list: list[str] + :ivar notification_preference: Notification preference for a job stage. + :vartype notification_preference: list["NotificationPreference"] + """ + + contactName: Required[str] + """Contact name of the person. Required.""" + phone: Required[str] + """Phone number of the contact person. Required.""" + phoneExtension: str + """Phone extension number of the contact person.""" + mobile: str + """Mobile number of the contact person.""" + emailList: Required[list[str]] + """List of Email-ids to be notified about job progress. Required.""" + notificationPreference: list["NotificationPreference"] + """Notification preference for a job stage.""" + + +class ContactInfo(TypedDict, total=False): + """Contact Info. + + :ivar contact_name: Contact name of the person. Required. + :vartype contact_name: str + :ivar phone: Phone number of the contact person. Required. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + """ + + contactName: Required[str] + """Contact name of the person. Required.""" + phone: Required[str] + """Phone number of the contact person. Required.""" + phoneExtension: str + """Phone extension number of the contact person.""" + mobile: str + """Mobile number of the contact person.""" + + +class CopyProgress(TypedDict, total=False): + """Copy progress. + + :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: Union[str, "TransferType"] + :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and + "ManagedDisk". + :vartype data_account_type: Union[str, "DataAccountType"] + :ivar account_id: Id of the account where the data needs to be uploaded. + :vartype account_id: str + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: int + :ivar total_bytes_to_process: Total amount of data to be processed by the job. + :vartype total_bytes_to_process: int + :ivar files_processed: Number of files processed. + :vartype files_processed: int + :ivar total_files_to_process: Total files to process. + :vartype total_files_to_process: int + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype invalid_files_processed: int + :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: int + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype renamed_container_count: int + :ivar files_errored_out: Number of files which could not be copied. + :vartype files_errored_out: int + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: int + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: int + :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 + :ivar error: Error, if any, in the stage. + :vartype error: "CloudError" + :ivar actions: Available actions on the job. + :vartype actions: list[Union[str, "CustomerResolutionCode"]] + """ + + storageAccountName: str + """Name of the storage account. This will be empty for data account types other than storage + account.""" + transferType: Union[str, "TransferType"] + """Transfer type of data. Known values are: \"ImportToAzure\" and \"ExportFromAzure\".""" + dataAccountType: Union[str, "DataAccountType"] + """Data Account Type. Known values are: \"StorageAccount\" and \"ManagedDisk\".""" + accountId: str + """Id of the account where the data needs to be uploaded.""" + bytesProcessed: int + """To indicate bytes transferred.""" + totalBytesToProcess: int + """Total amount of data to be processed by the job.""" + filesProcessed: int + """Number of files processed.""" + totalFilesToProcess: int + """Total files to process.""" + invalidFilesProcessed: int + """Number of files not adhering to azure naming conventions which were processed by automatic + renaming.""" + invalidFileBytesUploaded: int + """Total amount of data not adhering to azure naming conventions which were processed by automatic + renaming.""" + renamedContainerCount: int + """Number of folders not adhering to azure naming conventions which were processed by automatic + renaming.""" + filesErroredOut: int + """Number of files which could not be copied.""" + directoriesErroredOut: int + """To indicate directories errored out in the job.""" + invalidDirectoriesProcessed: int + """To indicate directories renamed.""" + isEnumerationInProgress: bool + """To indicate if enumeration of data is in progress. Until this is true, the TotalBytesToProcess + may not be valid.""" + error: "CloudError" + """Error, if any, in the stage.""" + actions: list[Union[str, "CustomerResolutionCode"]] + """Available actions on the job.""" + + +class CreateJobValidations(TypedDict, total=False): + """It does all pre-job creation validations. + + :ivar individual_request_details: List of request details contain validationType and its + request as key and value respectively. Required. + :vartype individual_request_details: list["ValidationInputRequest"] + :ivar validation_category: Identify the nature of validation. Required. Default value is + "JobCreationValidation". + :vartype validation_category: Literal["JobCreationValidation"] + """ + + individualRequestDetails: Required[list["ValidationInputRequest"]] + """List of request details contain validationType and its request as key and value respectively. + Required.""" + validationCategory: Required[Literal["JobCreationValidation"]] + """Identify the nature of validation. Required. Default value is \"JobCreationValidation\".""" + + +class CreateOrderLimitForSubscriptionValidationRequest(TypedDict, total=False): # pylint: disable=name-too-long + """Request to validate create order limit for current subscription. + + :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", + "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype device_type: Union[str, "SkuName"] + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response of create order limit for subscription validation. + :vartype validation_type: Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT] + """ + + deviceType: Required[Union[str, "SkuName"]] + """Device type to be used for the job. Required. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT]] + """Identifies the type of validation request. Required. Identify request and response of create + order limit for subscription validation.""" + + +class CreateOrderLimitForSubscriptionValidationResponseProperties( + TypedDict, total=False +): # pylint: disable=name-too-long + """Properties of create order limit for subscription validation response. + + :ivar error: Error code and message of validation response. + :vartype error: "CloudError" + :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and + "Skipped". + :vartype status: Union[str, "ValidationStatus"] + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response of create order limit for subscription validation. + :vartype validation_type: Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT] + """ + + error: "CloudError" + """Error code and message of validation response.""" + status: Union[str, "ValidationStatus"] + """Create order limit validation status. Known values are: \"Valid\", \"Invalid\", and + \"Skipped\".""" + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_CREATE_ORDER_LIMIT]] + """Identifies the type of validation response. Required. Identify request and response of create + order limit for subscription validation.""" + + +class CustomerDiskJobSecrets(TypedDict, total=False): + """The secrets related to customer disk job. + + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: "DcAccessSecurityCode" + :ivar error: Error while fetching the secrets. + :vartype error: "CloudError" + :ivar disk_secrets: Contains the list of secrets object for that device. + :vartype disk_secrets: list["DiskSecret"] + :ivar carrier_account_number: Carrier Account Number of the customer. + :vartype carrier_account_number: str + :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Data Box + Customer Disk orders. + :vartype job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + """ + + dcAccessSecurityCode: "DcAccessSecurityCode" + """Dc Access Security Code for Customer Managed Shipping.""" + error: "CloudError" + """Error while fetching the secrets.""" + diskSecrets: list["DiskSecret"] + """Contains the list of secrets object for that device.""" + carrierAccountNumber: str + """Carrier Account Number of the customer.""" + jobSecretsType: Required[Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK]] + """Used to indicate what type of job secrets object. Required. Data Box Customer Disk orders.""" + + +class DataBoxAccountCopyLogDetails(TypedDict, total=False): + """Copy log details for a storage account of a DataBox job. + + :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 + :ivar copy_log_details_type: Indicates the type of job details. Required. Data Box orders. + :vartype copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX] + """ + + accountName: str + """Account name.""" + copyLogLink: str + """Link for copy logs.""" + copyVerboseLogLink: str + """Link for copy verbose logs. This will be set only when LogCollectionLevel is set to Verbose.""" + copyLogDetailsType: Required[Literal[ClassDiscriminator.DATA_BOX]] + """Indicates the type of job details. Required. Data Box orders.""" + + +class DataBoxCustomerDiskCopyLogDetails(TypedDict, total=False): + """Copy Log Details for customer disk. + + :ivar serial_number: Disk Serial Number. + :vartype serial_number: str + :ivar error_log_link: Link for copy error logs. + :vartype error_log_link: str + :ivar verbose_log_link: Link for copy verbose logs. + :vartype verbose_log_link: str + :ivar copy_log_details_type: Indicates the type of job details. Required. Data Box Customer + Disk orders. + :vartype copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + """ + + serialNumber: str + """Disk Serial Number.""" + errorLogLink: str + """Link for copy error logs.""" + verboseLogLink: str + """Link for copy verbose logs.""" + copyLogDetailsType: Required[Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK]] + """Indicates the type of job details. Required. Data Box Customer Disk orders.""" + + +class DataBoxCustomerDiskCopyProgress(CopyProgress): + """DataBox CustomerDisk Copy Progress. + + :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: Union[str, "TransferType"] + :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and + "ManagedDisk". + :vartype data_account_type: Union[str, "DataAccountType"] + :ivar account_id: Id of the account where the data needs to be uploaded. + :vartype account_id: str + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: int + :ivar total_bytes_to_process: Total amount of data to be processed by the job. + :vartype total_bytes_to_process: int + :ivar files_processed: Number of files processed. + :vartype files_processed: int + :ivar total_files_to_process: Total files to process. + :vartype total_files_to_process: int + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype invalid_files_processed: int + :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: int + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype renamed_container_count: int + :ivar files_errored_out: Number of files which could not be copied. + :vartype files_errored_out: int + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: int + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: int + :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 + :ivar error: Error, if any, in the stage. + :vartype error: "CloudError" + :ivar actions: Available actions on the job. + :vartype actions: list[Union[str, "CustomerResolutionCode"]] + :ivar serial_number: Disk Serial Number. + :vartype serial_number: str + :ivar copy_status: The Status of the copy. Known values are: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", + "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", + "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". + :vartype copy_status: Union[str, "CopyStatus"] + """ + + serialNumber: str + """Disk Serial Number.""" + copyStatus: Union[str, "CopyStatus"] + """The Status of the copy. Known values are: \"NotStarted\", \"InProgress\", \"Completed\", + \"CompletedWithErrors\", \"Failed\", \"NotReturned\", \"HardwareError\", \"DeviceFormatted\", + \"DeviceMetadataModified\", \"StorageAccountNotAccessible\", \"UnsupportedData\", + \"DriveNotReceived\", \"UnsupportedDrive\", \"OtherServiceError\", \"OtherUserError\", + \"DriveNotDetected\", \"DriveCorrupted\", and \"MetadataFilesModifiedOrRemoved\".""" + + +class DataBoxCustomerDiskJobDetails(TypedDict, total=False): + """Customer disk job details. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list["JobStages"] + :ivar contact_details: Contact details for notification and shipping. Required. + :vartype contact_details: "ContactDetails" + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: "ShippingAddress" + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: "PackageShippingDetails" + :ivar return_package: Return package shipping details. + :vartype return_package: "PackageShippingDetails" + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list["DataImportDetails"] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list["DataExportDetails"] + :ivar preferences: Preferences for the order. + :vartype preferences: "Preferences" + :ivar reverse_shipping_details: Optional Reverse Shipping details for order. + :vartype reverse_shipping_details: "ReverseShippingDetails" + :ivar copy_log_details: List of copy log details. + :vartype copy_log_details: list["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. + :vartype chain_of_custody_sas_key: str + :ivar device_erasure_details: Holds device data erasure details. + :vartype device_erasure_details: "DeviceErasureDetails" + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: "KeyEncryptionKey" + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[Union[str, "CustomerResolutionCode"]] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: "LastMitigationActionOnJob" + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: "DatacenterAddressResponse" + :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", + "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", + "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", + "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", + "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", + "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", + "BJS20", "BL24", "IDC5", "TYO23", "NTG20", "DXB23", "DSM11", "AMS25", "CPQ21", and "OSA23". + :vartype data_center_code: Union[str, "DataCenterCode"] + :ivar import_disk_details_collection: Contains the map of disk serial number to the disk + details for import jobs. + :vartype import_disk_details_collection: dict[str, "ImportDiskDetails"] + :ivar export_disk_details_collection: Contains the map of disk serial number to the disk + details for export jobs. + :vartype export_disk_details_collection: dict[str, "ExportDiskDetails"] + :ivar copy_progress: Copy progress per disk. + :vartype copy_progress: list["DataBoxCustomerDiskCopyProgress"] + :ivar deliver_to_dc_package_details: Delivery package shipping details. + :vartype deliver_to_dc_package_details: "PackageCarrierInfo" + :ivar return_to_customer_package_details: Return package shipping details. Required. + :vartype return_to_customer_package_details: "PackageCarrierDetails" + :ivar enable_manifest_backup: Flag to indicate if disk manifest should be backed-up in the + Storage Account. + :vartype enable_manifest_backup: bool + :ivar job_details_type: Indicates the type of job details. Required. Data Box Customer Disk + orders. + :vartype job_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + """ + + jobStages: list["JobStages"] + """List of stages that run in the job.""" + contactDetails: Required["ContactDetails"] + """Contact details for notification and shipping. Required.""" + shippingAddress: "ShippingAddress" + """Shipping address of the customer.""" + deliveryPackage: "PackageShippingDetails" + """Delivery package shipping details.""" + returnPackage: "PackageShippingDetails" + """Return package shipping details.""" + dataImportDetails: list["DataImportDetails"] + """Details of the data to be imported into azure.""" + dataExportDetails: list["DataExportDetails"] + """Details of the data to be exported from azure.""" + preferences: "Preferences" + """Preferences for the order.""" + reverseShippingDetails: "ReverseShippingDetails" + """Optional Reverse Shipping details for order.""" + copyLogDetails: list["CopyLogDetails"] + """List of copy log details.""" + reverseShipmentLabelSasKey: str + """Shared access key to download the return shipment label.""" + chainOfCustodySasKey: str + """Shared access key to download the chain of custody logs.""" + deviceErasureDetails: "DeviceErasureDetails" + """Holds device data erasure details.""" + keyEncryptionKey: "KeyEncryptionKey" + """Details about which key encryption type is being used.""" + expectedDataSizeInTeraBytes: int + """The expected size of the data, which needs to be transferred in this job, in terabytes.""" + actions: list[Union[str, "CustomerResolutionCode"]] + """Available actions on the job.""" + lastMitigationActionOnJob: "LastMitigationActionOnJob" + """Last mitigation action performed on the job.""" + datacenterAddress: "DatacenterAddressResponse" + """Datacenter address to ship to, for the given sku and storage location.""" + dataCenterCode: Union[str, "DataCenterCode"] + """DataCenter code. Known values are: \"Invalid\", \"BY2\", \"BY1\", \"ORK70\", \"AM2\", + \"AMS20\", \"BY21\", \"BY24\", \"MWH01\", \"AMS06\", \"SSE90\", \"SYD03\", \"SYD23\", + \"CBR20\", \"YTO20\", \"CWL20\", \"LON24\", \"BOM01\", \"BL20\", \"BL7\", \"SEL20\", \"TYO01\", + \"BN1\", \"SN5\", \"CYS04\", \"TYO22\", \"YTO21\", \"YQB20\", \"FRA22\", \"MAA01\", \"CPQ02\", + \"CPQ20\", \"SIN20\", \"HKG20\", \"SG2\", \"MEL23\", \"SEL21\", \"OSA20\", \"SHA03\", \"BJB\", + \"JNB22\", \"JNB21\", \"MNZ21\", \"SN8\", \"AUH20\", \"ZRH20\", \"PUS20\", \"AdHoc\", \"CH1\", + \"DSM05\", \"DUB07\", \"PNQ01\", \"SVG20\", \"OSA02\", \"OSA22\", \"PAR22\", \"BN7\", \"SN6\", + \"BJS20\", \"BL24\", \"IDC5\", \"TYO23\", \"NTG20\", \"DXB23\", \"DSM11\", \"AMS25\", + \"CPQ21\", and \"OSA23\".""" + importDiskDetailsCollection: dict[str, "ImportDiskDetails"] + """Contains the map of disk serial number to the disk details for import jobs.""" + exportDiskDetailsCollection: dict[str, "ExportDiskDetails"] + """Contains the map of disk serial number to the disk details for export jobs.""" + copyProgress: list["DataBoxCustomerDiskCopyProgress"] + """Copy progress per disk.""" + deliverToDcPackageDetails: "PackageCarrierInfo" + """Delivery package shipping details.""" + returnToCustomerPackageDetails: Required["PackageCarrierDetails"] + """Return package shipping details. Required.""" + enableManifestBackup: bool + """Flag to indicate if disk manifest should be backed-up in the Storage Account.""" + jobDetailsType: Required[Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK]] + """Indicates the type of job details. Required. Data Box Customer Disk orders.""" + + +class DataBoxDiskCopyLogDetails(TypedDict, total=False): + """Copy Log Details for a disk. + + :ivar disk_serial_number: Disk Serial Number. + :vartype disk_serial_number: str + :ivar error_log_link: Link for copy error logs. + :vartype error_log_link: str + :ivar verbose_log_link: Link for copy verbose logs. + :vartype verbose_log_link: str + :ivar copy_log_details_type: Indicates the type of job details. Required. Data Box Disk orders. + :vartype copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_DISK] + """ + + diskSerialNumber: str + """Disk Serial Number.""" + errorLogLink: str + """Link for copy error logs.""" + verboseLogLink: str + """Link for copy verbose logs.""" + copyLogDetailsType: Required[Literal[ClassDiscriminator.DATA_BOX_DISK]] + """Indicates the type of job details. Required. Data Box Disk orders.""" + + +class DataBoxDiskCopyProgress(TypedDict, total=False): + """DataBox Disk Copy Progress. + + :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: int + :ivar percent_complete: Indicates the percentage completed for the copy of the disk. + :vartype percent_complete: int + :ivar status: The Status of the copy. Known values are: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", + "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", + "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". + :vartype status: Union[str, "CopyStatus"] + :ivar error: Error, if any, in the stage. + :vartype error: "CloudError" + :ivar actions: Available actions on the job. + :vartype actions: list[Union[str, "CustomerResolutionCode"]] + """ + + serialNumber: str + """The serial number of the disk.""" + bytesCopied: int + """Bytes copied during the copy of disk.""" + percentComplete: int + """Indicates the percentage completed for the copy of the disk.""" + status: Union[str, "CopyStatus"] + """The Status of the copy. Known values are: \"NotStarted\", \"InProgress\", \"Completed\", + \"CompletedWithErrors\", \"Failed\", \"NotReturned\", \"HardwareError\", \"DeviceFormatted\", + \"DeviceMetadataModified\", \"StorageAccountNotAccessible\", \"UnsupportedData\", + \"DriveNotReceived\", \"UnsupportedDrive\", \"OtherServiceError\", \"OtherUserError\", + \"DriveNotDetected\", \"DriveCorrupted\", and \"MetadataFilesModifiedOrRemoved\".""" + error: "CloudError" + """Error, if any, in the stage.""" + actions: list[Union[str, "CustomerResolutionCode"]] + """Available actions on the job.""" + + +class DataBoxDiskGranularCopyLogDetails(TypedDict, total=False): + """Granular Copy Log Details for customer disk. + + :ivar serial_number: Disk Serial Number. + :vartype serial_number: str + :ivar account_id: Account id. + :vartype account_id: str + :ivar error_log_link: Link for copy error logs. + :vartype error_log_link: str + :ivar verbose_log_link: Link for copy verbose logs. + :vartype verbose_log_link: str + :ivar copy_log_details_type: Indicates the type of job details. Required. Data Box Customer + Disk orders. + :vartype copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK] + """ + + serialNumber: str + """Disk Serial Number.""" + accountId: str + """Account id.""" + errorLogLink: str + """Link for copy error logs.""" + verboseLogLink: str + """Link for copy verbose logs.""" + copyLogDetailsType: Required[Literal[ClassDiscriminator.DATA_BOX_CUSTOMER_DISK]] + """Indicates the type of job details. Required. Data Box Customer Disk orders.""" + + +class GranularCopyProgress(TypedDict, total=False): + """Granular Copy progress. + + :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: Union[str, "TransferType"] + :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and + "ManagedDisk". + :vartype data_account_type: Union[str, "DataAccountType"] + :ivar account_id: Id of the account where the data needs to be uploaded. + :vartype account_id: str + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: int + :ivar total_bytes_to_process: Total amount of data to be processed by the job. + :vartype total_bytes_to_process: int + :ivar files_processed: Number of files processed. + :vartype files_processed: int + :ivar total_files_to_process: Total files to process. + :vartype total_files_to_process: int + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype invalid_files_processed: int + :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: int + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype renamed_container_count: int + :ivar files_errored_out: Number of files which could not be copied. + :vartype files_errored_out: int + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: int + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: int + :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 + :ivar error: Error, if any, in the stage. + :vartype error: "CloudError" + :ivar actions: Available actions on the job. + :vartype actions: list[Union[str, "CustomerResolutionCode"]] + """ + + storageAccountName: str + """Name of the storage account. This will be empty for data account types other than storage + account.""" + transferType: Union[str, "TransferType"] + """Transfer type of data. Known values are: \"ImportToAzure\" and \"ExportFromAzure\".""" + dataAccountType: Union[str, "DataAccountType"] + """Data Account Type. Known values are: \"StorageAccount\" and \"ManagedDisk\".""" + accountId: str + """Id of the account where the data needs to be uploaded.""" + bytesProcessed: int + """To indicate bytes transferred.""" + totalBytesToProcess: int + """Total amount of data to be processed by the job.""" + filesProcessed: int + """Number of files processed.""" + totalFilesToProcess: int + """Total files to process.""" + invalidFilesProcessed: int + """Number of files not adhering to azure naming conventions which were processed by automatic + renaming.""" + invalidFileBytesUploaded: int + """Total amount of data not adhering to azure naming conventions which were processed by automatic + renaming.""" + renamedContainerCount: int + """Number of folders not adhering to azure naming conventions which were processed by automatic + renaming.""" + filesErroredOut: int + """Number of files which could not be copied.""" + directoriesErroredOut: int + """To indicate directories errored out in the job.""" + invalidDirectoriesProcessed: int + """To indicate directories renamed.""" + isEnumerationInProgress: bool + """To indicate if enumeration of data is in progress. Until this is true, the TotalBytesToProcess + may not be valid.""" + error: "CloudError" + """Error, if any, in the stage.""" + actions: list[Union[str, "CustomerResolutionCode"]] + """Available actions on the job.""" + + +class DataBoxDiskGranularCopyProgress(GranularCopyProgress): + """DataBox Disk Granular Copy Progress. + + :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 transfer_type: Transfer type of data. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: Union[str, "TransferType"] + :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and + "ManagedDisk". + :vartype data_account_type: Union[str, "DataAccountType"] + :ivar account_id: Id of the account where the data needs to be uploaded. + :vartype account_id: str + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: int + :ivar total_bytes_to_process: Total amount of data to be processed by the job. + :vartype total_bytes_to_process: int + :ivar files_processed: Number of files processed. + :vartype files_processed: int + :ivar total_files_to_process: Total files to process. + :vartype total_files_to_process: int + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype invalid_files_processed: int + :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: int + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype renamed_container_count: int + :ivar files_errored_out: Number of files which could not be copied. + :vartype files_errored_out: int + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: int + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: int + :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 + :ivar error: Error, if any, in the stage. + :vartype error: "CloudError" + :ivar actions: Available actions on the job. + :vartype actions: list[Union[str, "CustomerResolutionCode"]] + :ivar serial_number: Disk Serial Number. + :vartype serial_number: str + :ivar copy_status: The Status of the copy. Known values are: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", + "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", + "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". + :vartype copy_status: Union[str, "CopyStatus"] + """ + + serialNumber: str + """Disk Serial Number.""" + copyStatus: Union[str, "CopyStatus"] + """The Status of the copy. Known values are: \"NotStarted\", \"InProgress\", \"Completed\", + \"CompletedWithErrors\", \"Failed\", \"NotReturned\", \"HardwareError\", \"DeviceFormatted\", + \"DeviceMetadataModified\", \"StorageAccountNotAccessible\", \"UnsupportedData\", + \"DriveNotReceived\", \"UnsupportedDrive\", \"OtherServiceError\", \"OtherUserError\", + \"DriveNotDetected\", \"DriveCorrupted\", and \"MetadataFilesModifiedOrRemoved\".""" + + +class DataBoxDiskJobDetails(TypedDict, total=False): + """DataBox Disk Job Details. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list["JobStages"] + :ivar contact_details: Contact details for notification and shipping. Required. + :vartype contact_details: "ContactDetails" + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: "ShippingAddress" + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: "PackageShippingDetails" + :ivar return_package: Return package shipping details. + :vartype return_package: "PackageShippingDetails" + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list["DataImportDetails"] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list["DataExportDetails"] + :ivar preferences: Preferences for the order. + :vartype preferences: "Preferences" + :ivar reverse_shipping_details: Optional Reverse Shipping details for order. + :vartype reverse_shipping_details: "ReverseShippingDetails" + :ivar copy_log_details: List of copy log details. + :vartype copy_log_details: list["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. + :vartype chain_of_custody_sas_key: str + :ivar device_erasure_details: Holds device data erasure details. + :vartype device_erasure_details: "DeviceErasureDetails" + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: "KeyEncryptionKey" + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[Union[str, "CustomerResolutionCode"]] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: "LastMitigationActionOnJob" + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: "DatacenterAddressResponse" + :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", + "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", + "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", + "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", + "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", + "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", + "BJS20", "BL24", "IDC5", "TYO23", "NTG20", "DXB23", "DSM11", "AMS25", "CPQ21", and "OSA23". + :vartype data_center_code: Union[str, "DataCenterCode"] + :ivar 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. + :vartype preferred_disks: dict[str, int] + :ivar copy_progress: Copy progress per disk. + :vartype copy_progress: list["DataBoxDiskCopyProgress"] + :ivar granular_copy_progress: Copy progress per disk. + :vartype granular_copy_progress: list["DataBoxDiskGranularCopyProgress"] + :ivar granular_copy_log_details: Copy progress per disk. + :vartype granular_copy_log_details: list["DataBoxDiskGranularCopyLogDetails"] + :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] + :ivar passkey: User entered passkey for DataBox Disk job. + :vartype passkey: str + :ivar job_details_type: Indicates the type of job details. Required. Data Box Disk orders. + :vartype job_details_type: Literal[ClassDiscriminator.DATA_BOX_DISK] + """ + + jobStages: list["JobStages"] + """List of stages that run in the job.""" + contactDetails: Required["ContactDetails"] + """Contact details for notification and shipping. Required.""" + shippingAddress: "ShippingAddress" + """Shipping address of the customer.""" + deliveryPackage: "PackageShippingDetails" + """Delivery package shipping details.""" + returnPackage: "PackageShippingDetails" + """Return package shipping details.""" + dataImportDetails: list["DataImportDetails"] + """Details of the data to be imported into azure.""" + dataExportDetails: list["DataExportDetails"] + """Details of the data to be exported from azure.""" + preferences: "Preferences" + """Preferences for the order.""" + reverseShippingDetails: "ReverseShippingDetails" + """Optional Reverse Shipping details for order.""" + copyLogDetails: list["CopyLogDetails"] + """List of copy log details.""" + reverseShipmentLabelSasKey: str + """Shared access key to download the return shipment label.""" + chainOfCustodySasKey: str + """Shared access key to download the chain of custody logs.""" + deviceErasureDetails: "DeviceErasureDetails" + """Holds device data erasure details.""" + keyEncryptionKey: "KeyEncryptionKey" + """Details about which key encryption type is being used.""" + expectedDataSizeInTeraBytes: int + """The expected size of the data, which needs to be transferred in this job, in terabytes.""" + actions: list[Union[str, "CustomerResolutionCode"]] + """Available actions on the job.""" + lastMitigationActionOnJob: "LastMitigationActionOnJob" + """Last mitigation action performed on the job.""" + datacenterAddress: "DatacenterAddressResponse" + """Datacenter address to ship to, for the given sku and storage location.""" + dataCenterCode: Union[str, "DataCenterCode"] + """DataCenter code. Known values are: \"Invalid\", \"BY2\", \"BY1\", \"ORK70\", \"AM2\", + \"AMS20\", \"BY21\", \"BY24\", \"MWH01\", \"AMS06\", \"SSE90\", \"SYD03\", \"SYD23\", + \"CBR20\", \"YTO20\", \"CWL20\", \"LON24\", \"BOM01\", \"BL20\", \"BL7\", \"SEL20\", \"TYO01\", + \"BN1\", \"SN5\", \"CYS04\", \"TYO22\", \"YTO21\", \"YQB20\", \"FRA22\", \"MAA01\", \"CPQ02\", + \"CPQ20\", \"SIN20\", \"HKG20\", \"SG2\", \"MEL23\", \"SEL21\", \"OSA20\", \"SHA03\", \"BJB\", + \"JNB22\", \"JNB21\", \"MNZ21\", \"SN8\", \"AUH20\", \"ZRH20\", \"PUS20\", \"AdHoc\", \"CH1\", + \"DSM05\", \"DUB07\", \"PNQ01\", \"SVG20\", \"OSA02\", \"OSA22\", \"PAR22\", \"BN7\", \"SN6\", + \"BJS20\", \"BL24\", \"IDC5\", \"TYO23\", \"NTG20\", \"DXB23\", \"DSM11\", \"AMS25\", + \"CPQ21\", and \"OSA23\".""" + preferredDisks: dict[str, int] + """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.""" + copyProgress: list["DataBoxDiskCopyProgress"] + """Copy progress per disk.""" + granularCopyProgress: list["DataBoxDiskGranularCopyProgress"] + """Copy progress per disk.""" + granularCopyLogDetails: list["DataBoxDiskGranularCopyLogDetails"] + """Copy progress per disk.""" + disksAndSizeDetails: dict[str, int] + """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.""" + passkey: str + """User entered passkey for DataBox Disk job.""" + jobDetailsType: Required[Literal[ClassDiscriminator.DATA_BOX_DISK]] + """Indicates the type of job details. Required. Data Box Disk orders.""" + + +class DataBoxDiskJobSecrets(TypedDict, total=False): + """The secrets related to disk job. + + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: "DcAccessSecurityCode" + :ivar error: Error while fetching the secrets. + :vartype error: "CloudError" + :ivar disk_secrets: Contains the list of secrets object for that device. + :vartype disk_secrets: list["DiskSecret"] + :ivar pass_key: PassKey for the disk Job. + :vartype pass_key: str + :ivar is_passkey_user_defined: Whether passkey was provided by user. + :vartype is_passkey_user_defined: bool + :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Data Box + Disk orders. + :vartype job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_DISK] + """ + + dcAccessSecurityCode: "DcAccessSecurityCode" + """Dc Access Security Code for Customer Managed Shipping.""" + error: "CloudError" + """Error while fetching the secrets.""" + diskSecrets: list["DiskSecret"] + """Contains the list of secrets object for that device.""" + passKey: str + """PassKey for the disk Job.""" + isPasskeyUserDefined: bool + """Whether passkey was provided by user.""" + jobSecretsType: Required[Literal[ClassDiscriminator.DATA_BOX_DISK]] + """Used to indicate what type of job secrets object. Required. Data Box Disk orders.""" + + +class DataBoxHeavyAccountCopyLogDetails(TypedDict, total=False): + """Copy log details for a storage account for Databox heavy. + + :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] + :ivar copy_log_details_type: Indicates the type of job details. Required. Data Box Heavy + orders. + :vartype copy_log_details_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] + """ + + accountName: str + """Account name.""" + copyLogLink: list[str] + """Link for copy logs.""" + copyVerboseLogLink: list[str] + """Link for copy verbose logs. This will be set only when the LogCollectionLevel is set to + verbose.""" + copyLogDetailsType: Required[Literal[ClassDiscriminator.DATA_BOX_HEAVY]] + """Indicates the type of job details. Required. Data Box Heavy orders.""" + + +class DataBoxHeavyJobDetails(TypedDict, total=False): + """Databox Heavy Device Job Details. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list["JobStages"] + :ivar contact_details: Contact details for notification and shipping. Required. + :vartype contact_details: "ContactDetails" + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: "ShippingAddress" + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: "PackageShippingDetails" + :ivar return_package: Return package shipping details. + :vartype return_package: "PackageShippingDetails" + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list["DataImportDetails"] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list["DataExportDetails"] + :ivar preferences: Preferences for the order. + :vartype preferences: "Preferences" + :ivar reverse_shipping_details: Optional Reverse Shipping details for order. + :vartype reverse_shipping_details: "ReverseShippingDetails" + :ivar copy_log_details: List of copy log details. + :vartype copy_log_details: list["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. + :vartype chain_of_custody_sas_key: str + :ivar device_erasure_details: Holds device data erasure details. + :vartype device_erasure_details: "DeviceErasureDetails" + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: "KeyEncryptionKey" + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[Union[str, "CustomerResolutionCode"]] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: "LastMitigationActionOnJob" + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: "DatacenterAddressResponse" + :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", + "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", + "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", + "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", + "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", + "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", + "BJS20", "BL24", "IDC5", "TYO23", "NTG20", "DXB23", "DSM11", "AMS25", "CPQ21", and "OSA23". + :vartype data_center_code: Union[str, "DataCenterCode"] + :ivar copy_progress: Copy progress per account. + :vartype copy_progress: list["CopyProgress"] + :ivar 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 : @#\\-$%^!+=;:_()]+. + :vartype device_password: str + :ivar job_details_type: Indicates the type of job details. Required. Data Box Heavy orders. + :vartype job_details_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] + """ + + jobStages: list["JobStages"] + """List of stages that run in the job.""" + contactDetails: Required["ContactDetails"] + """Contact details for notification and shipping. Required.""" + shippingAddress: "ShippingAddress" + """Shipping address of the customer.""" + deliveryPackage: "PackageShippingDetails" + """Delivery package shipping details.""" + returnPackage: "PackageShippingDetails" + """Return package shipping details.""" + dataImportDetails: list["DataImportDetails"] + """Details of the data to be imported into azure.""" + dataExportDetails: list["DataExportDetails"] + """Details of the data to be exported from azure.""" + preferences: "Preferences" + """Preferences for the order.""" + reverseShippingDetails: "ReverseShippingDetails" + """Optional Reverse Shipping details for order.""" + copyLogDetails: list["CopyLogDetails"] + """List of copy log details.""" + reverseShipmentLabelSasKey: str + """Shared access key to download the return shipment label.""" + chainOfCustodySasKey: str + """Shared access key to download the chain of custody logs.""" + deviceErasureDetails: "DeviceErasureDetails" + """Holds device data erasure details.""" + keyEncryptionKey: "KeyEncryptionKey" + """Details about which key encryption type is being used.""" + expectedDataSizeInTeraBytes: int + """The expected size of the data, which needs to be transferred in this job, in terabytes.""" + actions: list[Union[str, "CustomerResolutionCode"]] + """Available actions on the job.""" + lastMitigationActionOnJob: "LastMitigationActionOnJob" + """Last mitigation action performed on the job.""" + datacenterAddress: "DatacenterAddressResponse" + """Datacenter address to ship to, for the given sku and storage location.""" + dataCenterCode: Union[str, "DataCenterCode"] + """DataCenter code. Known values are: \"Invalid\", \"BY2\", \"BY1\", \"ORK70\", \"AM2\", + \"AMS20\", \"BY21\", \"BY24\", \"MWH01\", \"AMS06\", \"SSE90\", \"SYD03\", \"SYD23\", + \"CBR20\", \"YTO20\", \"CWL20\", \"LON24\", \"BOM01\", \"BL20\", \"BL7\", \"SEL20\", \"TYO01\", + \"BN1\", \"SN5\", \"CYS04\", \"TYO22\", \"YTO21\", \"YQB20\", \"FRA22\", \"MAA01\", \"CPQ02\", + \"CPQ20\", \"SIN20\", \"HKG20\", \"SG2\", \"MEL23\", \"SEL21\", \"OSA20\", \"SHA03\", \"BJB\", + \"JNB22\", \"JNB21\", \"MNZ21\", \"SN8\", \"AUH20\", \"ZRH20\", \"PUS20\", \"AdHoc\", \"CH1\", + \"DSM05\", \"DUB07\", \"PNQ01\", \"SVG20\", \"OSA02\", \"OSA22\", \"PAR22\", \"BN7\", \"SN6\", + \"BJS20\", \"BL24\", \"IDC5\", \"TYO23\", \"NTG20\", \"DXB23\", \"DSM11\", \"AMS25\", + \"CPQ21\", and \"OSA23\".""" + copyProgress: list["CopyProgress"] + """Copy progress per account.""" + devicePassword: str + """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 : @#\\-$%^!+=;:_()]+.""" + jobDetailsType: Required[Literal[ClassDiscriminator.DATA_BOX_HEAVY]] + """Indicates the type of job details. Required. Data Box Heavy orders.""" + + +class DataBoxHeavyJobSecrets(TypedDict, total=False): + """The secrets related to a databox heavy job. + + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: "DcAccessSecurityCode" + :ivar error: Error while fetching the secrets. + :vartype error: "CloudError" + :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. + :vartype cabinet_pod_secrets: list["DataBoxHeavySecret"] + :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Data Box + Heavy orders. + :vartype job_secrets_type: Literal[ClassDiscriminator.DATA_BOX_HEAVY] + """ + + dcAccessSecurityCode: "DcAccessSecurityCode" + """Dc Access Security Code for Customer Managed Shipping.""" + error: "CloudError" + """Error while fetching the secrets.""" + cabinetPodSecrets: list["DataBoxHeavySecret"] + """Contains the list of secret objects for a databox heavy job.""" + jobSecretsType: Required[Literal[ClassDiscriminator.DATA_BOX_HEAVY]] + """Used to indicate what type of job secrets object. Required. Data Box Heavy orders.""" + + +class DataBoxHeavySecret(TypedDict, total=False): + """The secrets related to a databox heavy. + + :ivar device_serial_number: Serial number of the assigned device. + :vartype device_serial_number: str + :ivar device_password: Password for out of the box experience on device. + :vartype device_password: str + :ivar network_configurations: Network configuration of the appliance. + :vartype network_configurations: list["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["AccountCredentialDetails"] + """ + + deviceSerialNumber: str + """Serial number of the assigned device.""" + devicePassword: str + """Password for out of the box experience on device.""" + networkConfigurations: list["ApplianceNetworkConfiguration"] + """Network configuration of the appliance.""" + encodedValidationCertPubKey: str + """The base 64 encoded public key to authenticate with the device.""" + accountCredentialDetails: list["AccountCredentialDetails"] + """Per account level access credentials.""" + + +class DataBoxJobDetails(TypedDict, total=False): + """Databox Job Details. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list["JobStages"] + :ivar contact_details: Contact details for notification and shipping. Required. + :vartype contact_details: "ContactDetails" + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: "ShippingAddress" + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: "PackageShippingDetails" + :ivar return_package: Return package shipping details. + :vartype return_package: "PackageShippingDetails" + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list["DataImportDetails"] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list["DataExportDetails"] + :ivar preferences: Preferences for the order. + :vartype preferences: "Preferences" + :ivar reverse_shipping_details: Optional Reverse Shipping details for order. + :vartype reverse_shipping_details: "ReverseShippingDetails" + :ivar copy_log_details: List of copy log details. + :vartype copy_log_details: list["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. + :vartype chain_of_custody_sas_key: str + :ivar device_erasure_details: Holds device data erasure details. + :vartype device_erasure_details: "DeviceErasureDetails" + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: "KeyEncryptionKey" + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[Union[str, "CustomerResolutionCode"]] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: "LastMitigationActionOnJob" + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: "DatacenterAddressResponse" + :ivar data_center_code: DataCenter code. Known values are: "Invalid", "BY2", "BY1", "ORK70", + "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", "YTO20", + "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", "TYO22", + "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", "MEL23", + "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", + "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", + "BJS20", "BL24", "IDC5", "TYO23", "NTG20", "DXB23", "DSM11", "AMS25", "CPQ21", and "OSA23". + :vartype data_center_code: Union[str, "DataCenterCode"] + :ivar copy_progress: Copy progress per storage account. + :vartype copy_progress: list["CopyProgress"] + :ivar 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 : @#\\-$%^!+=;:_()]+. + :vartype device_password: str + :ivar job_details_type: Indicates the type of job details. Required. Data Box orders. + :vartype job_details_type: Literal[ClassDiscriminator.DATA_BOX] + """ + + jobStages: list["JobStages"] + """List of stages that run in the job.""" + contactDetails: Required["ContactDetails"] + """Contact details for notification and shipping. Required.""" + shippingAddress: "ShippingAddress" + """Shipping address of the customer.""" + deliveryPackage: "PackageShippingDetails" + """Delivery package shipping details.""" + returnPackage: "PackageShippingDetails" + """Return package shipping details.""" + dataImportDetails: list["DataImportDetails"] + """Details of the data to be imported into azure.""" + dataExportDetails: list["DataExportDetails"] + """Details of the data to be exported from azure.""" + preferences: "Preferences" + """Preferences for the order.""" + reverseShippingDetails: "ReverseShippingDetails" + """Optional Reverse Shipping details for order.""" + copyLogDetails: list["CopyLogDetails"] + """List of copy log details.""" + reverseShipmentLabelSasKey: str + """Shared access key to download the return shipment label.""" + chainOfCustodySasKey: str + """Shared access key to download the chain of custody logs.""" + deviceErasureDetails: "DeviceErasureDetails" + """Holds device data erasure details.""" + keyEncryptionKey: "KeyEncryptionKey" + """Details about which key encryption type is being used.""" + expectedDataSizeInTeraBytes: int + """The expected size of the data, which needs to be transferred in this job, in terabytes.""" + actions: list[Union[str, "CustomerResolutionCode"]] + """Available actions on the job.""" + lastMitigationActionOnJob: "LastMitigationActionOnJob" + """Last mitigation action performed on the job.""" + datacenterAddress: "DatacenterAddressResponse" + """Datacenter address to ship to, for the given sku and storage location.""" + dataCenterCode: Union[str, "DataCenterCode"] + """DataCenter code. Known values are: \"Invalid\", \"BY2\", \"BY1\", \"ORK70\", \"AM2\", + \"AMS20\", \"BY21\", \"BY24\", \"MWH01\", \"AMS06\", \"SSE90\", \"SYD03\", \"SYD23\", + \"CBR20\", \"YTO20\", \"CWL20\", \"LON24\", \"BOM01\", \"BL20\", \"BL7\", \"SEL20\", \"TYO01\", + \"BN1\", \"SN5\", \"CYS04\", \"TYO22\", \"YTO21\", \"YQB20\", \"FRA22\", \"MAA01\", \"CPQ02\", + \"CPQ20\", \"SIN20\", \"HKG20\", \"SG2\", \"MEL23\", \"SEL21\", \"OSA20\", \"SHA03\", \"BJB\", + \"JNB22\", \"JNB21\", \"MNZ21\", \"SN8\", \"AUH20\", \"ZRH20\", \"PUS20\", \"AdHoc\", \"CH1\", + \"DSM05\", \"DUB07\", \"PNQ01\", \"SVG20\", \"OSA02\", \"OSA22\", \"PAR22\", \"BN7\", \"SN6\", + \"BJS20\", \"BL24\", \"IDC5\", \"TYO23\", \"NTG20\", \"DXB23\", \"DSM11\", \"AMS25\", + \"CPQ21\", and \"OSA23\".""" + copyProgress: list["CopyProgress"] + """Copy progress per storage account.""" + devicePassword: str + """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 : @#\\-$%^!+=;:_()]+.""" + jobDetailsType: Required[Literal[ClassDiscriminator.DATA_BOX]] + """Indicates the type of job details. Required. Data Box orders.""" + + +class DataboxJobSecrets(TypedDict, total=False): + """The secrets related to a databox job. + + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: "DcAccessSecurityCode" + :ivar error: Error while fetching the secrets. + :vartype error: "CloudError" + :ivar pod_secrets: Contains the list of secret objects for a job. + :vartype pod_secrets: list["DataBoxSecret"] + :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Data Box + orders. + :vartype job_secrets_type: Literal[ClassDiscriminator.DATA_BOX] + """ + + dcAccessSecurityCode: "DcAccessSecurityCode" + """Dc Access Security Code for Customer Managed Shipping.""" + error: "CloudError" + """Error while fetching the secrets.""" + podSecrets: list["DataBoxSecret"] + """Contains the list of secret objects for a job.""" + jobSecretsType: Required[Literal[ClassDiscriminator.DATA_BOX]] + """Used to indicate what type of job secrets object. Required. Data Box orders.""" + + +class DataBoxScheduleAvailabilityRequest(TypedDict, total=False): + """Request body to get the availability for scheduling data box orders orders. + + :ivar storage_location: Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype storage_location: str + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + :ivar sku_name: Sku Name for which the order is to be scheduled. Required. Data Box. + :vartype sku_name: Literal[SkuName.DATA_BOX] + """ + + storageLocation: Required[str] + """Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required.""" + country: str + """Country in which storage location should be supported.""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + skuName: Required[Literal[SkuName.DATA_BOX]] + """Sku Name for which the order is to be scheduled. Required. Data Box.""" + + +class DataBoxSecret(TypedDict, total=False): + """The secrets related to a DataBox. + + :ivar device_serial_number: Serial number of the assigned device. + :vartype device_serial_number: str + :ivar device_password: Password for out of the box experience on device. + :vartype device_password: str + :ivar network_configurations: Network configuration of the appliance. + :vartype network_configurations: list["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["AccountCredentialDetails"] + """ + + deviceSerialNumber: str + """Serial number of the assigned device.""" + devicePassword: str + """Password for out of the box experience on device.""" + networkConfigurations: list["ApplianceNetworkConfiguration"] + """Network configuration of the appliance.""" + encodedValidationCertPubKey: str + """The base 64 encoded public key to authenticate with the device.""" + accountCredentialDetails: list["AccountCredentialDetails"] + """Per account level access credentials.""" + + +class DatacenterAddressInstructionResponse(TypedDict, total=False): + """Datacenter instruction for given storage location. + + :ivar supported_carriers_for_return_shipment: List of supported carriers for return shipment. + :vartype supported_carriers_for_return_shipment: list[str] + :ivar data_center_azure_location: Azure Location where the Data Center serves primarily. + :vartype data_center_azure_location: str + :ivar communication_instruction: Data center communication instruction. + :vartype communication_instruction: str + :ivar datacenter_address_type: Data center address type. Required. Data center address + instruction. + :vartype datacenter_address_type: Literal[DatacenterAddressType.DATACENTER_ADDRESS_INSTRUCTION] + """ + + supportedCarriersForReturnShipment: list[str] + """List of supported carriers for return shipment.""" + dataCenterAzureLocation: str + """Azure Location where the Data Center serves primarily.""" + communicationInstruction: str + """Data center communication instruction.""" + datacenterAddressType: Required[Literal[DatacenterAddressType.DATACENTER_ADDRESS_INSTRUCTION]] + """Data center address type. Required. Data center address instruction.""" + + +class DatacenterAddressLocationResponse(TypedDict, total=False): + """Datacenter address for given storage location. + + :ivar supported_carriers_for_return_shipment: List of supported carriers for return shipment. + :vartype supported_carriers_for_return_shipment: list[str] + :ivar data_center_azure_location: Azure Location where the Data Center serves primarily. + :vartype data_center_azure_location: str + :ivar contact_person_name: Contact person name. + :vartype contact_person_name: str + :ivar company: Company name. + :vartype company: str + :ivar street1: Street address line 1. + :vartype street1: str + :ivar street2: Street address line 2. + :vartype street2: str + :ivar street3: Street address line 3. + :vartype street3: str + :ivar city: City name. + :vartype city: str + :ivar state: name of the state. + :vartype state: str + :ivar zip: Zip code. + :vartype zip: str + :ivar country: name of the country. + :vartype country: str + :ivar phone: Phone number. + :vartype phone: str + :ivar phone_extension: Phone extension. + :vartype phone_extension: str + :ivar address_type: Address type. + :vartype address_type: str + :ivar additional_shipping_information: Special instruction for shipping. + :vartype additional_shipping_information: str + :ivar datacenter_address_type: Data center address type. Required. Data center address + location. + :vartype datacenter_address_type: Literal[DatacenterAddressType.DATACENTER_ADDRESS_LOCATION] + """ + + supportedCarriersForReturnShipment: list[str] + """List of supported carriers for return shipment.""" + dataCenterAzureLocation: str + """Azure Location where the Data Center serves primarily.""" + contactPersonName: str + """Contact person name.""" + company: str + """Company name.""" + street1: str + """Street address line 1.""" + street2: str + """Street address line 2.""" + street3: str + """Street address line 3.""" + city: str + """City name.""" + state: str + """name of the state.""" + zip: str + """Zip code.""" + country: str + """name of the country.""" + phone: str + """Phone number.""" + phoneExtension: str + """Phone extension.""" + addressType: str + """Address type.""" + additionalShippingInformation: str + """Special instruction for shipping.""" + datacenterAddressType: Required[Literal[DatacenterAddressType.DATACENTER_ADDRESS_LOCATION]] + """Data center address type. Required. Data center address location.""" + + +class DatacenterAddressRequest(TypedDict, total=False): + """Request body to get the datacenter address. + + :ivar storage_location: Storage location. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype storage_location: str + :ivar sku_name: Sku Name for which the data center address requested. Required. Known values + are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype sku_name: Union[str, "SkuName"] + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + """ + + storageLocation: Required[str] + """Storage location. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required.""" + skuName: Required[Union[str, "SkuName"]] + """Sku Name for which the data center address requested. Required. Known values are: \"DataBox\", + \"DataBoxDisk\", \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + + +class DataExportDetails(TypedDict, total=False): + """Details of the data to be used for exporting data from azure. + + :ivar transfer_configuration: Configuration for the data transfer. Required. + :vartype transfer_configuration: "TransferConfiguration" + :ivar log_collection_level: Level of the logs to be collected. Known values are: "Error" and + "Verbose". + :vartype log_collection_level: Union[str, "LogCollectionLevel"] + :ivar account_details: Account details of the data to be transferred. Required. + :vartype account_details: "DataAccountDetails" + """ + + transferConfiguration: Required["TransferConfiguration"] + """Configuration for the data transfer. Required.""" + logCollectionLevel: Union[str, "LogCollectionLevel"] + """Level of the logs to be collected. Known values are: \"Error\" and \"Verbose\".""" + accountDetails: Required["DataAccountDetails"] + """Account details of the data to be transferred. Required.""" + + +class DataImportDetails(TypedDict, total=False): + """Details of the data to be used for importing data to azure. + + :ivar account_details: Account details of the data to be transferred. Required. + :vartype account_details: "DataAccountDetails" + :ivar log_collection_level: Level of the logs to be collected. Known values are: "Error" and + "Verbose". + :vartype log_collection_level: Union[str, "LogCollectionLevel"] + """ + + accountDetails: Required["DataAccountDetails"] + """Account details of the data to be transferred. Required.""" + logCollectionLevel: Union[str, "LogCollectionLevel"] + """Level of the logs to be collected. Known values are: \"Error\" and \"Verbose\".""" + + +class DataLocationToServiceLocationMap(TypedDict, total=False): + """Map of data location to service location. + + :ivar data_location: Location of the data. + :vartype data_location: str + :ivar service_location: Location of the service. + :vartype service_location: str + """ + + dataLocation: str + """Location of the data.""" + serviceLocation: str + """Location of the service.""" + + +class DataTransferDetailsValidationRequest(TypedDict, total=False): + """Request to validate export and import data details. + + :ivar data_export_details: List of DataTransfer details to be used to export data from azure. + :vartype data_export_details: list["DataExportDetails"] + :ivar data_import_details: List of DataTransfer details to be used to import data to azure. + :vartype data_import_details: list["DataImportDetails"] + :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype device_type: Union[str, "SkuName"] + :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: Union[str, "TransferType"] + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response of data transfer details validation. + :vartype validation_type: Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS] + """ + + dataExportDetails: list["DataExportDetails"] + """List of DataTransfer details to be used to export data from azure.""" + dataImportDetails: list["DataImportDetails"] + """List of DataTransfer details to be used to import data to azure.""" + deviceType: Required[Union[str, "SkuName"]] + """Device type. Required. Known values are: \"DataBox\", \"DataBoxDisk\", \"DataBoxHeavy\", and + \"DataBoxCustomerDisk\".""" + transferType: Required[Union[str, "TransferType"]] + """Type of the transfer. Required. Known values are: \"ImportToAzure\" and \"ExportFromAzure\".""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS]] + """Identifies the type of validation request. Required. Identify request and response of data + transfer details validation.""" + + +class DataTransferDetailsValidationResponseProperties(TypedDict, total=False): # pylint: disable=name-too-long + """Properties of data transfer details validation response. + + :ivar error: Error code and message of validation response. + :vartype error: "CloudError" + :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", + and "Skipped". + :vartype status: Union[str, "ValidationStatus"] + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response of data transfer details validation. + :vartype validation_type: Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS] + """ + + error: "CloudError" + """Error code and message of validation response.""" + status: Union[str, "ValidationStatus"] + """Data transfer details validation status. Known values are: \"Valid\", \"Invalid\", and + \"Skipped\".""" + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_DATA_TRANSFER_DETAILS]] + """Identifies the type of validation response. Required. Identify request and response of data + transfer details validation.""" + + +class DcAccessSecurityCode(TypedDict, total=False): + """Dc access security code. + + :ivar reverse_dc_access_code: Reverse Dc access security code. + :vartype reverse_dc_access_code: str + :ivar forward_dc_access_code: Forward Dc access security code. + :vartype forward_dc_access_code: str + """ + + reverseDCAccessCode: str + """Reverse Dc access security code.""" + forwardDCAccessCode: str + """Forward Dc access security code.""" + + +class Details(TypedDict, total=False): + """Details. + + :ivar code: Error code. Required. + :vartype code: str + :ivar message: Error message. Required. + :vartype message: str + """ + + code: Required[str] + """Error code. Required.""" + message: Required[str] + """Error message. Required.""" + + +class DeviceCapabilityDetails(TypedDict, total=False): + """Device capability details for a given sku for a given region. + + :ivar hardware_encryption: Hardware encryption support for a given sku for a given region. + Known values are: "Enabled" and "Disabled". + :vartype hardware_encryption: Union[str, "HardwareEncryption"] + """ + + hardwareEncryption: Union[str, "HardwareEncryption"] + """Hardware encryption support for a given sku for a given region. Known values are: \"Enabled\" + and \"Disabled\".""" + + +class DeviceCapabilityRequest(TypedDict, total=False): + """Request body to get the device capabilities for given sku. + + :ivar sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", + and "DataBoxCustomerDisk". + :vartype sku_name: Union[str, "SkuName"] + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + """ + + skuName: Union[str, "SkuName"] + """Type of the device. Known values are: \"DataBox\", \"DataBoxDisk\", \"DataBoxHeavy\", and + \"DataBoxCustomerDisk\".""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + + +class DeviceCapabilityResponse(TypedDict, total=False): + """Device capabilities for given sku in a region. + + :ivar device_capability_details: List of device capabilities available for a given region and a + given sku. + :vartype device_capability_details: list["DeviceCapabilityDetails"] + """ + + deviceCapabilityDetails: list["DeviceCapabilityDetails"] + """List of device capabilities available for a given region and a given sku.""" + + +class DeviceErasureDetails(TypedDict, total=False): + """Device erasure details with erasure completion status, secure erasure sas key and + erasureordestructionlog sas key. + + :ivar device_erasure_status: Holds the device erasure completion status. Known values are: + "None", "InProgress", "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", + "WaitingForCustomerAction", "SucceededWithWarnings", "WaitingForCustomerActionForKek", + "WaitingForCustomerActionForCleanUp", "CustomerActionPerformedForCleanUp", and + "CustomerActionPerformed". + :vartype device_erasure_status: Union[str, "StageStatus"] + :ivar erasure_or_destruction_certificate_sas_key: Shared access key to download cleanup or + destruction certificate for device. + :vartype erasure_or_destruction_certificate_sas_key: str + :ivar secure_erasure_certificate_sas_key: Shared access key to download secure erasure + certificate for the device. + :vartype secure_erasure_certificate_sas_key: str + """ + + deviceErasureStatus: Union[str, "StageStatus"] + """Holds the device erasure completion status. Known values are: \"None\", \"InProgress\", + \"Succeeded\", \"Failed\", \"Cancelled\", \"Cancelling\", \"SucceededWithErrors\", + \"WaitingForCustomerAction\", \"SucceededWithWarnings\", \"WaitingForCustomerActionForKek\", + \"WaitingForCustomerActionForCleanUp\", \"CustomerActionPerformedForCleanUp\", and + \"CustomerActionPerformed\".""" + erasureOrDestructionCertificateSasKey: str + """Shared access key to download cleanup or destruction certificate for device.""" + secureErasureCertificateSasKey: str + """Shared access key to download secure erasure certificate for the device.""" + + +class DiskScheduleAvailabilityRequest(TypedDict, total=False): + """Request body to get the availability for scheduling disk orders. + + :ivar storage_location: Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype storage_location: str + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. Required. + :vartype expected_data_size_in_tera_bytes: int + :ivar sku_name: Sku Name for which the order is to be scheduled. Required. Data Box Disk. + :vartype sku_name: Literal[SkuName.DATA_BOX_DISK] + """ + + storageLocation: Required[str] + """Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required.""" + country: str + """Country in which storage location should be supported.""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + expectedDataSizeInTeraBytes: Required[int] + """The expected size of the data, which needs to be transferred in this job, in terabytes. + Required.""" + skuName: Required[Literal[SkuName.DATA_BOX_DISK]] + """Sku Name for which the order is to be scheduled. Required. Data Box Disk.""" + + +class DiskSecret(TypedDict, total=False): + """Contains all the secrets of a Disk. + + :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. + :vartype bit_locker_key: str + """ + + diskSerialNumber: str + """Serial number of the assigned disk.""" + bitLockerKey: str + """Bit Locker key of the disk which can be used to unlock the disk to copy data.""" + + +class EncryptionPreferences(TypedDict, total=False): + """Preferences related to the Encryption. + + :ivar double_encryption: Defines secondary layer of software-based encryption enablement. Known + values are: "Enabled" and "Disabled". + :vartype double_encryption: Union[str, "DoubleEncryption"] + :ivar hardware_encryption: Defines Hardware level encryption (Only for disk). Known values are: + "Enabled" and "Disabled". + :vartype hardware_encryption: Union[str, "HardwareEncryption"] + """ + + doubleEncryption: Union[str, "DoubleEncryption"] + """Defines secondary layer of software-based encryption enablement. Known values are: \"Enabled\" + and \"Disabled\".""" + hardwareEncryption: Union[str, "HardwareEncryption"] + """Defines Hardware level encryption (Only for disk). Known values are: \"Enabled\" and + \"Disabled\".""" + + +class ErrorDetail(TypedDict, total=False): + """ErrorDetail. + + :ivar code: Error code. Required. + :vartype code: str + :ivar message: Error message. Required. + :vartype message: str + :ivar details: Error target. + :vartype details: list["Details"] + :ivar target: Additional error info. + :vartype target: str + """ + + code: Required[str] + """Error code. Required.""" + message: Required[str] + """Error message. Required.""" + details: list["Details"] + """Error target.""" + target: str + """Additional error info.""" + + +class ExportDiskDetails(TypedDict, total=False): + """Export disk details. + + :ivar manifest_file: The relative path of the manifest file on the disk. + :vartype manifest_file: str + :ivar manifest_hash: The Base16-encoded MD5 hash of the manifest file on the disk. + :vartype manifest_hash: str + :ivar backup_manifest_cloud_path: Path to backed up manifest, only returned if + enableManifestBackup is true. + :vartype backup_manifest_cloud_path: str + """ + + manifestFile: str + """The relative path of the manifest file on the disk.""" + manifestHash: str + """The Base16-encoded MD5 hash of the manifest file on the disk.""" + backupManifestCloudPath: str + """Path to backed up manifest, only returned if enableManifestBackup is true.""" + + +class FilterFileDetails(TypedDict, total=False): + """Details of the filter files to be used for data transfer. + + :ivar filter_file_type: Type of the filter file. Required. Known values are: "AzureBlob" and + "AzureFile". + :vartype filter_file_type: Union[str, "FilterFileType"] + :ivar filter_file_path: Path of the file that contains the details of all items to transfer. + Required. + :vartype filter_file_path: str + """ + + filterFileType: Required[Union[str, "FilterFileType"]] + """Type of the filter file. Required. Known values are: \"AzureBlob\" and \"AzureFile\".""" + filterFilePath: Required[str] + """Path of the file that contains the details of all items to transfer. Required.""" + + +class HeavyScheduleAvailabilityRequest(TypedDict, total=False): + """Request body to get the availability for scheduling heavy orders. + + :ivar storage_location: Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype storage_location: str + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + :ivar sku_name: Sku Name for which the order is to be scheduled. Required. Data Box Heavy. + :vartype sku_name: Literal[SkuName.DATA_BOX_HEAVY] + """ + + storageLocation: Required[str] + """Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required.""" + country: str + """Country in which storage location should be supported.""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + skuName: Required[Literal[SkuName.DATA_BOX_HEAVY]] + """Sku Name for which the order is to be scheduled. Required. Data Box Heavy.""" + + +class IdentityProperties(TypedDict, total=False): + """Managed identity properties. + + :ivar type: Managed service identity type. + :vartype type: str + :ivar user_assigned: User assigned identity properties. + :vartype user_assigned: "UserAssignedProperties" + """ + + type: str + """Managed service identity type.""" + userAssigned: "UserAssignedProperties" + """User assigned identity properties.""" + + +class ImportDiskDetails(TypedDict, total=False): + """Import disk details. + + :ivar manifest_file: The relative path of the manifest file on the disk. Required. + :vartype manifest_file: str + :ivar manifest_hash: The Base16-encoded MD5 hash of the manifest file on the disk. Required. + :vartype manifest_hash: str + :ivar bit_locker_key: BitLocker key used to encrypt the disk. Required. + :vartype bit_locker_key: str + :ivar backup_manifest_cloud_path: Path to backed up manifest, only returned if + enableManifestBackup is true. + :vartype backup_manifest_cloud_path: str + """ + + manifestFile: Required[str] + """The relative path of the manifest file on the disk. Required.""" + manifestHash: Required[str] + """The Base16-encoded MD5 hash of the manifest file on the disk. Required.""" + bitLockerKey: Required[str] + """BitLocker key used to encrypt the disk. Required.""" + backupManifestCloudPath: str + """Path to backed up manifest, only returned if enableManifestBackup is true.""" + + +class JobDelayDetails(TypedDict, total=False): + """Job Delay Notification details. + + :ivar status: Status of notification. Known values are: "Active" and "Resolved". + :vartype status: Union[str, "DelayNotificationStatus"] + :ivar error_code: Delay Error code. Known values are: "InternalIssueDelay", + "ActiveOrderLimitBreachedDelay", "HighDemandDelay", and "LargeNumberOfFilesDelay". + :vartype error_code: Union[str, "PortalDelayErrorCode"] + :ivar description: Description of the delay. + :vartype description: str + :ivar start_time: Timestamp when the delay notification was created. + :vartype start_time: str + :ivar resolution_time: Timestamp when the delay notification was resolved. + :vartype resolution_time: str + """ + + status: Union[str, "DelayNotificationStatus"] + """Status of notification. Known values are: \"Active\" and \"Resolved\".""" + errorCode: Union[str, "PortalDelayErrorCode"] + """Delay Error code. Known values are: \"InternalIssueDelay\", \"ActiveOrderLimitBreachedDelay\", + \"HighDemandDelay\", and \"LargeNumberOfFilesDelay\".""" + description: str + """Description of the delay.""" + startTime: str + """Timestamp when the delay notification was created.""" + resolutionTime: str + """Timestamp when the delay notification was resolved.""" + + +class JobDeliveryInfo(TypedDict, total=False): + """Additional delivery info. + + :ivar scheduled_date_time: Scheduled date time. + :vartype scheduled_date_time: str + """ + + scheduledDateTime: str + """Scheduled date time.""" + + +class JobProperties(TypedDict, total=False): + """Job Properties. + + :ivar transfer_type: Type of the data transfer. Required. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: Union[str, "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. + :vartype is_shipping_address_editable: bool + :ivar reverse_shipping_details_update: The Editable status for Reverse Shipping Address and + Contact Info. Known values are: "Enabled", "Disabled", and "NotSupported". + :vartype reverse_shipping_details_update: Union[str, "ReverseShippingDetailsEditStatus"] + :ivar reverse_transport_preference_update: The Editable status for Reverse Transport + preferences. Known values are: "Enabled", "Disabled", and "NotSupported". + :vartype reverse_transport_preference_update: Union[str, + "ReverseTransportPreferenceEditStatus"] + :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. Known values are: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", + "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", and "ShippedToCustomer". + :vartype status: Union[str, "StageName"] + :ivar delayed_stage: Name of the stage where delay might be present. Known values are: + "DeviceOrdered", "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", + "DataCopy", "Completed", "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", + "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", and "ShippedToCustomer". + :vartype delayed_stage: Union[str, "StageName"] + :ivar start_time: Time at which the job was started in UTC ISO 8601 format. + :vartype start_time: str + :ivar error: Top level error for the job. + :vartype error: "CloudError" + :ivar details: Details of a job run. This field will only be sent for expand details filter. + :vartype details: "JobDetails" + :ivar cancellation_reason: Reason for cancellation. + :vartype cancellation_reason: str + :ivar delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". + :vartype delivery_type: Union[str, "JobDeliveryType"] + :ivar delivery_info: Delivery Info of Job. + :vartype delivery_info: "JobDeliveryInfo" + :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. + :vartype is_cancellable_without_fee: bool + :ivar all_devices_lost: Flag to indicate if all devices associated with the job are lost. + :vartype all_devices_lost: bool + """ + + transferType: Required[Union[str, "TransferType"]] + """Type of the data transfer. Required. Known values are: \"ImportToAzure\" and + \"ExportFromAzure\".""" + isCancellable: bool + """Describes whether the job is cancellable or not.""" + isDeletable: bool + """Describes whether the job is deletable or not.""" + isShippingAddressEditable: bool + """Describes whether the shipping address is editable or not.""" + reverseShippingDetailsUpdate: Union[str, "ReverseShippingDetailsEditStatus"] + """The Editable status for Reverse Shipping Address and Contact Info. Known values are: + \"Enabled\", \"Disabled\", and \"NotSupported\".""" + reverseTransportPreferenceUpdate: Union[str, "ReverseTransportPreferenceEditStatus"] + """The Editable status for Reverse Transport preferences. Known values are: \"Enabled\", + \"Disabled\", and \"NotSupported\".""" + isPrepareToShipEnabled: bool + """Is Prepare To Ship Enabled on this job.""" + status: Union[str, "StageName"] + """Name of the stage which is in progress. Known values are: \"DeviceOrdered\", + \"DevicePrepared\", \"Dispatched\", \"Delivered\", \"PickedUp\", \"AtAzureDC\", \"DataCopy\", + \"Completed\", \"CompletedWithErrors\", \"Cancelled\", \"Failed_IssueReportedAtCustomer\", + \"Failed_IssueDetectedAtAzureDC\", \"Aborted\", \"CompletedWithWarnings\", + \"ReadyToDispatchFromAzureDC\", \"ReadyToReceiveAtAzureDC\", \"Created\", \"ShippedToAzureDC\", + \"AwaitingShipmentDetails\", \"PreparingToShipFromAzureDC\", and \"ShippedToCustomer\".""" + delayedStage: Union[str, "StageName"] + """Name of the stage where delay might be present. Known values are: \"DeviceOrdered\", + \"DevicePrepared\", \"Dispatched\", \"Delivered\", \"PickedUp\", \"AtAzureDC\", \"DataCopy\", + \"Completed\", \"CompletedWithErrors\", \"Cancelled\", \"Failed_IssueReportedAtCustomer\", + \"Failed_IssueDetectedAtAzureDC\", \"Aborted\", \"CompletedWithWarnings\", + \"ReadyToDispatchFromAzureDC\", \"ReadyToReceiveAtAzureDC\", \"Created\", \"ShippedToAzureDC\", + \"AwaitingShipmentDetails\", \"PreparingToShipFromAzureDC\", and \"ShippedToCustomer\".""" + startTime: str + """Time at which the job was started in UTC ISO 8601 format.""" + error: "CloudError" + """Top level error for the job.""" + details: "JobDetails" + """Details of a job run. This field will only be sent for expand details filter.""" + cancellationReason: str + """Reason for cancellation.""" + deliveryType: Union[str, "JobDeliveryType"] + """Delivery type of Job. Known values are: \"NonScheduled\" and \"Scheduled\".""" + deliveryInfo: "JobDeliveryInfo" + """Delivery Info of Job.""" + isCancellableWithoutFee: bool + """Flag to indicate cancellation of scheduled job.""" + allDevicesLost: bool + """Flag to indicate if all devices associated with the job are lost.""" + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class JobResource(TrackedResource): + """Job Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Properties of a job. Required. + :vartype properties: "JobProperties" + :ivar sku: The sku type. Required. + :vartype sku: "Sku" + :ivar identity: Msi identity of the resource. + :vartype identity: "ResourceIdentity" + """ + + properties: Required["JobProperties"] + """Properties of a job. Required.""" + sku: Required["Sku"] + """The sku type. Required.""" + identity: "ResourceIdentity" + """Msi identity of the resource.""" + + +class JobResourceUpdateParameter(TypedDict, total=False): + """The JobResourceUpdateParameter. + + :ivar properties: Properties of a job to be updated. + :vartype properties: "UpdateJobProperties" + :ivar 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). + :vartype tags: dict[str, str] + :ivar identity: Msi identity of the resource. + :vartype identity: "ResourceIdentity" + """ + + properties: "UpdateJobProperties" + """Properties of a job to be updated.""" + tags: dict[str, str] + """The list of key value pairs that describe the resource. These tags can be used in viewing and + grouping this resource (across resource groups).""" + identity: "ResourceIdentity" + """Msi identity of the resource.""" + + +class JobStages(TypedDict, total=False): + """Job stages. + + :ivar stage_name: Name of the job stage. Known values are: "DeviceOrdered", "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", + "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", and "ShippedToCustomer". + :vartype stage_name: Union[str, "StageName"] + :ivar display_name: Display name of the job stage. + :vartype display_name: str + :ivar stage_status: Status of the job stage. Known values are: "None", "InProgress", + "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", + "WaitingForCustomerAction", "SucceededWithWarnings", "WaitingForCustomerActionForKek", + "WaitingForCustomerActionForCleanUp", "CustomerActionPerformedForCleanUp", and + "CustomerActionPerformed". + :vartype stage_status: Union[str, "StageStatus"] + :ivar stage_time: Time for the job stage in UTC ISO 8601 format. + :vartype stage_time: str + :ivar job_stage_details: Job Stage Details. + :vartype job_stage_details: Any + :ivar delay_information: Delay information for the job stages. + :vartype delay_information: list["JobDelayDetails"] + """ + + stageName: Union[str, "StageName"] + """Name of the job stage. Known values are: \"DeviceOrdered\", \"DevicePrepared\", \"Dispatched\", + \"Delivered\", \"PickedUp\", \"AtAzureDC\", \"DataCopy\", \"Completed\", + \"CompletedWithErrors\", \"Cancelled\", \"Failed_IssueReportedAtCustomer\", + \"Failed_IssueDetectedAtAzureDC\", \"Aborted\", \"CompletedWithWarnings\", + \"ReadyToDispatchFromAzureDC\", \"ReadyToReceiveAtAzureDC\", \"Created\", \"ShippedToAzureDC\", + \"AwaitingShipmentDetails\", \"PreparingToShipFromAzureDC\", and \"ShippedToCustomer\".""" + displayName: str + """Display name of the job stage.""" + stageStatus: Union[str, "StageStatus"] + """Status of the job stage. Known values are: \"None\", \"InProgress\", \"Succeeded\", \"Failed\", + \"Cancelled\", \"Cancelling\", \"SucceededWithErrors\", \"WaitingForCustomerAction\", + \"SucceededWithWarnings\", \"WaitingForCustomerActionForKek\", + \"WaitingForCustomerActionForCleanUp\", \"CustomerActionPerformedForCleanUp\", and + \"CustomerActionPerformed\".""" + stageTime: str + """Time for the job stage in UTC ISO 8601 format.""" + jobStageDetails: Any + """Job Stage Details.""" + delayInformation: list["JobDelayDetails"] + """Delay information for the job stages.""" + + +class KeyEncryptionKey(TypedDict, total=False): + """Encryption key containing details about key to encrypt different keys. + + :ivar kek_type: Type of encryption key used for key encryption. Required. Known values are: + "MicrosoftManaged" and "CustomerManaged". + :vartype kek_type: Union[str, "KekType"] + :ivar identity_properties: Managed identity properties used for key encryption. + :vartype identity_properties: "IdentityProperties" + :ivar kek_url: Key encryption key. It is required in case of Customer managed KekType. + :vartype kek_url: str + :ivar kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + KekType. + :vartype kek_vault_resource_id: str + """ + + kekType: Required[Union[str, "KekType"]] + """Type of encryption key used for key encryption. Required. Known values are: + \"MicrosoftManaged\" and \"CustomerManaged\".""" + identityProperties: "IdentityProperties" + """Managed identity properties used for key encryption.""" + kekUrl: str + """Key encryption key. It is required in case of Customer managed KekType.""" + kekVaultResourceID: str + """Kek vault resource id. It is required in case of Customer managed KekType.""" + + +class LastMitigationActionOnJob(TypedDict, total=False): + """Last Mitigation Action Performed On Job. + + :ivar action_date_time_in_utc: Action performed date time. + :vartype action_date_time_in_utc: str + :ivar is_performed_by_customer: Action performed by customer, possibility is that mitigation + might happen by customer or service or by ops. + :vartype is_performed_by_customer: bool + :ivar customer_resolution: Resolution code provided by customer. Known values are: "None", + "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". + :vartype customer_resolution: Union[str, "CustomerResolutionCode"] + """ + + actionDateTimeInUtc: str + """Action performed date time.""" + isPerformedByCustomer: bool + """Action performed by customer, possibility is that mitigation might happen by customer or + service or by ops.""" + customerResolution: Union[str, "CustomerResolutionCode"] + """Resolution code provided by customer. Known values are: \"None\", \"MoveToCleanUpDevice\", + \"Resume\", \"Restart\", and \"ReachOutToOperation\".""" + + +class ManagedDiskDetails(TypedDict, total=False): + """Details of the managed disks. + + :ivar 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 : @#\\-$%^!+=;:_()]+. + :vartype share_password: str + :ivar resource_group_id: Resource Group Id of the compute disks. Required. + :vartype resource_group_id: str + :ivar staging_storage_account_id: Resource Id of the storage account that can be used to copy + the vhd for staging. Required. + :vartype staging_storage_account_id: str + :ivar data_account_type: Account Type of the data to be transferred. Required. Azure Managed + disk storage. + :vartype data_account_type: Literal[DataAccountType.MANAGED_DISK] + """ + + sharePassword: str + """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 : @#\\-$%^!+=;:_()]+.""" + resourceGroupId: Required[str] + """Resource Group Id of the compute disks. Required.""" + stagingStorageAccountId: Required[str] + """Resource Id of the storage account that can be used to copy the vhd for staging. Required.""" + dataAccountType: Required[Literal[DataAccountType.MANAGED_DISK]] + """Account Type of the data to be transferred. Required. Azure Managed disk storage.""" + + +class MarkDevicesShippedRequest(TypedDict, total=False): + """The request body to provide the delivery package details of job. + + :ivar deliver_to_dc_package_details: Delivery package details. Required. + :vartype deliver_to_dc_package_details: "PackageCarrierInfo" + """ + + deliverToDcPackageDetails: Required["PackageCarrierInfo"] + """Delivery package details. Required.""" + + +class MitigateJobRequest(TypedDict, total=False): + """The Mitigate Job captured from request body for Mitigate API. + + :ivar customer_resolution_code: Resolution code for the job. Known values are: "None", + "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". + :vartype customer_resolution_code: Union[str, "CustomerResolutionCode"] + :ivar serial_number_customer_resolution_map: Serial number and the customer resolution code + corresponding to each serial number. + :vartype serial_number_customer_resolution_map: dict[str, Union[str, "CustomerResolutionCode"]] + """ + + customerResolutionCode: Union[str, "CustomerResolutionCode"] + """Resolution code for the job. Known values are: \"None\", \"MoveToCleanUpDevice\", \"Resume\", + \"Restart\", and \"ReachOutToOperation\".""" + serialNumberCustomerResolutionMap: dict[str, Union[str, "CustomerResolutionCode"]] + """Serial number and the customer resolution code corresponding to each serial number.""" + + +class NotificationPreference(TypedDict, total=False): + """Notification preference for a job stage. + + :ivar stage_name: Name of the stage. Required. Known values are: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Created", and + "ShippedToCustomer". + :vartype stage_name: Union[str, "NotificationStageName"] + :ivar send_notification: Notification is required or not. Required. + :vartype send_notification: bool + """ + + stageName: Required[Union[str, "NotificationStageName"]] + """Name of the stage. Required. Known values are: \"DevicePrepared\", \"Dispatched\", + \"Delivered\", \"PickedUp\", \"AtAzureDC\", \"DataCopy\", \"Created\", and + \"ShippedToCustomer\".""" + sendNotification: Required[bool] + """Notification is required or not. Required.""" + + +class Operation(TypedDict, total=False): + """Operation entity. + + :ivar name: Name of the operation. Format: + {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. + :vartype name: str + :ivar display: Operation display values. + :vartype display: "OperationDisplay" + :ivar properties: Operation properties. + :vartype properties: "OperationProperties" + :ivar origin: Origin of the operation. Can be : user|system|user,system. + :vartype origin: str + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool + """ + + name: str + """Name of the operation. Format: + {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}.""" + display: "OperationDisplay" + """Operation display values.""" + properties: "OperationProperties" + """Operation properties.""" + origin: str + """Origin of the operation. Can be : user|system|user,system.""" + isDataAction: bool + """Indicates whether the operation is a data action.""" + + +class OperationDisplay(TypedDict, total=False): + """Operation display. + + :ivar provider: Provider name. + :vartype provider: str + :ivar resource: Resource name. + :vartype resource: str + :ivar operation: Localized name of the operation for display purpose. + :vartype operation: str + :ivar description: Localized description of the operation for display purpose. + :vartype description: str + """ + + provider: str + """Provider name.""" + resource: str + """Resource name.""" + operation: str + """Localized name of the operation for display purpose.""" + description: str + """Localized description of the operation for display purpose.""" + + +class OperationProperties(TypedDict, total=False): + """Operation properties.""" + + +class PackageCarrierDetails(TypedDict, total=False): + """Package carrier details. + + :ivar carrier_account_number: Carrier Account Number of customer for customer disk. + :vartype carrier_account_number: str + :ivar carrier_name: Name of the carrier. + :vartype carrier_name: str + :ivar tracking_id: Tracking Id of shipment. + :vartype tracking_id: str + """ + + carrierAccountNumber: str + """Carrier Account Number of customer for customer disk.""" + carrierName: str + """Name of the carrier.""" + trackingId: str + """Tracking Id of shipment.""" + + +class PackageCarrierInfo(TypedDict, total=False): + """package carrier info. + + :ivar carrier_name: Name of the carrier. + :vartype carrier_name: str + :ivar tracking_id: Tracking Id of shipment. + :vartype tracking_id: str + """ + + carrierName: str + """Name of the carrier.""" + trackingId: str + """Tracking Id of shipment.""" + + +class PackageShippingDetails(TypedDict, total=False): + """package shipping details. + + :ivar tracking_url: Url where shipment can be tracked. + :vartype tracking_url: str + :ivar carrier_name: Name of the carrier. + :vartype carrier_name: str + :ivar tracking_id: Tracking Id of shipment. + :vartype tracking_id: str + """ + + trackingUrl: str + """Url where shipment can be tracked.""" + carrierName: str + """Name of the carrier.""" + trackingId: str + """Tracking Id of shipment.""" + + +class Preferences(TypedDict, total=False): + """Preferences related to the order. + + :ivar preferred_data_center_region: Preferred data center region. + :vartype preferred_data_center_region: list[str] + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: "TransportPreferences" + :ivar reverse_transport_preferences: Optional Preferences related to the reverse shipment + logistics of the sku. + :vartype reverse_transport_preferences: "TransportPreferences" + :ivar encryption_preferences: Preferences related to the Encryption. + :vartype encryption_preferences: "EncryptionPreferences" + :ivar storage_account_access_tier_preferences: Preferences related to the Access Tier of + storage accounts. + :vartype storage_account_access_tier_preferences: list[Literal["Archive"]] + """ + + preferredDataCenterRegion: list[str] + """Preferred data center region.""" + transportPreferences: "TransportPreferences" + """Preferences related to the shipment logistics of the sku.""" + reverseTransportPreferences: "TransportPreferences" + """Optional Preferences related to the reverse shipment logistics of the sku.""" + encryptionPreferences: "EncryptionPreferences" + """Preferences related to the Encryption.""" + storageAccountAccessTierPreferences: list[Literal["Archive"]] + """Preferences related to the Access Tier of storage accounts.""" + + +class PreferencesValidationRequest(TypedDict, total=False): + """Request to validate preference of transport and data center. + + :ivar preference: Preference of transport and data center. + :vartype preference: "Preferences" + :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", + "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype device_type: Union[str, "SkuName"] + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response of preference validation. + :vartype validation_type: Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES] + """ + + preference: "Preferences" + """Preference of transport and data center.""" + deviceType: Required[Union[str, "SkuName"]] + """Device type to be used for the job. Required. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES]] + """Identifies the type of validation request. Required. Identify request and response of + preference validation.""" + + +class PreferencesValidationResponseProperties(TypedDict, total=False): + """Properties of data center and transport preference validation response. + + :ivar error: Error code and message of validation response. + :vartype error: "CloudError" + :ivar status: Validation status of requested data center and transport. Known values are: + "Valid", "Invalid", and "Skipped". + :vartype status: Union[str, "ValidationStatus"] + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response of preference validation. + :vartype validation_type: Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES] + """ + + error: "CloudError" + """Error code and message of validation response.""" + status: Union[str, "ValidationStatus"] + """Validation status of requested data center and transport. Known values are: \"Valid\", + \"Invalid\", and \"Skipped\".""" + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_PREFERENCES]] + """Identifies the type of validation response. Required. Identify request and response of + preference validation.""" + + +class RegionConfigurationRequest(TypedDict, total=False): + """Request body to get the configuration for the region. + + :ivar schedule_availability_request: Request body to get the availability for scheduling + orders. + :vartype schedule_availability_request: "ScheduleAvailabilityRequest" + :ivar transport_availability_request: Request body to get the transport availability for given + sku. + :vartype transport_availability_request: "TransportAvailabilityRequest" + :ivar datacenter_address_request: Request body to get the datacenter address for given sku. + :vartype datacenter_address_request: "DatacenterAddressRequest" + :ivar device_capability_request: Request body to get the device capabilities for a given sku. + :vartype device_capability_request: "DeviceCapabilityRequest" + """ + + scheduleAvailabilityRequest: "ScheduleAvailabilityRequest" + """Request body to get the availability for scheduling orders.""" + transportAvailabilityRequest: "TransportAvailabilityRequest" + """Request body to get the transport availability for given sku.""" + datacenterAddressRequest: "DatacenterAddressRequest" + """Request body to get the datacenter address for given sku.""" + deviceCapabilityRequest: "DeviceCapabilityRequest" + """Request body to get the device capabilities for a given sku.""" + + +class RegionConfigurationResponse(TypedDict, total=False): + """Configuration response specific to a region. + + :ivar schedule_availability_response: Schedule availability for given sku in a region. + :vartype schedule_availability_response: "ScheduleAvailabilityResponse" + :ivar transport_availability_response: Transport options available for given sku in a region. + :vartype transport_availability_response: "TransportAvailabilityResponse" + :ivar datacenter_address_response: Datacenter address for given sku in a region. + :vartype datacenter_address_response: "DatacenterAddressResponse" + :ivar device_capability_response: Device capabilities available for a given sku in a region. + :vartype device_capability_response: "DeviceCapabilityResponse" + """ + + scheduleAvailabilityResponse: "ScheduleAvailabilityResponse" + """Schedule availability for given sku in a region.""" + transportAvailabilityResponse: "TransportAvailabilityResponse" + """Transport options available for given sku in a region.""" + datacenterAddressResponse: "DatacenterAddressResponse" + """Datacenter address for given sku in a region.""" + deviceCapabilityResponse: "DeviceCapabilityResponse" + """Device capabilities available for a given sku in a region.""" + + +class ResourceIdentity(TypedDict, total=False): + """Msi identity details of the resource. + + :ivar type: Identity type. + :vartype 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 + :ivar user_assigned_identities: User Assigned Identities. + :vartype user_assigned_identities: dict[str, "UserAssignedIdentity"] + """ + + type: str + """Identity type.""" + principalId: str + """Service Principal Id backing the Msi.""" + tenantId: str + """Home Tenant Id.""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """User Assigned Identities.""" + + +class ReverseShippingDetails(TypedDict, total=False): + """Reverse Shipping Address and contact details for a job. + + :ivar contact_details: Contact Info. + :vartype contact_details: "ContactInfo" + :ivar shipping_address: Shipping address where customer wishes to receive the device. + :vartype shipping_address: "ShippingAddress" + :ivar is_updated: A flag to indicate whether Reverse Shipping details are updated or not after + device has been prepared. Read only field. + :vartype is_updated: bool + """ + + contactDetails: "ContactInfo" + """Contact Info.""" + shippingAddress: "ShippingAddress" + """Shipping address where customer wishes to receive the device.""" + isUpdated: bool + """A flag to indicate whether Reverse Shipping details are updated or not after device has been + prepared. Read only field.""" + + +class ScheduleAvailabilityResponse(TypedDict, total=False): + """Schedule availability for given sku in a region. + + :ivar available_dates: List of dates available to schedule. + :vartype available_dates: list[str] + """ + + availableDates: list[str] + """List of dates available to schedule.""" + + +class ShareCredentialDetails(TypedDict, total=False): + """Credential details of the shares in account. + + :ivar share_name: Name of the share. + :vartype share_name: str + :ivar share_type: Type of the share. Known values are: "UnknownType", "HCS", "BlockBlob", + "PageBlob", "AzureFile", and "ManagedDisk". + :vartype share_type: Union[str, "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. + :vartype supported_access_protocols: list[Union[str, "AccessProtocol"]] + """ + + shareName: str + """Name of the share.""" + shareType: Union[str, "ShareDestinationFormatType"] + """Type of the share. Known values are: \"UnknownType\", \"HCS\", \"BlockBlob\", \"PageBlob\", + \"AzureFile\", and \"ManagedDisk\".""" + userName: str + """User name for the share.""" + password: str + """Password for the share.""" + supportedAccessProtocols: list[Union[str, "AccessProtocol"]] + """Access protocols supported on the device.""" + + +class ShipmentPickUpRequest(TypedDict, total=False): + """Shipment pick up request details. + + :ivar start_time: Minimum date after which the pick up should commence, this must be in local + time of pick up area. Required. + :vartype start_time: str + :ivar end_time: Maximum date before which the pick up should commence, this must be in local + time of pick up area. Required. + :vartype end_time: str + :ivar shipment_location: Shipment Location in the pickup place. Eg.front desk. Required. + :vartype shipment_location: str + """ + + startTime: Required[str] + """Minimum date after which the pick up should commence, this must be in local time of pick up + area. Required.""" + endTime: Required[str] + """Maximum date before which the pick up should commence, this must be in local time of pick up + area. Required.""" + shipmentLocation: Required[str] + """Shipment Location in the pickup place. Eg.front desk. Required.""" + + +class ShipmentPickUpResponse(TypedDict, total=False): + """Shipment pick up response. + + :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: str + """ + + confirmationNumber: str + """Confirmation number for the pick up request.""" + readyByTime: str + """Time by which shipment should be ready for pick up, this is in local time of pick up area.""" + + +class ShippingAddress(TypedDict, total=False): + """Shipping address where customer wishes to receive the device. + + :ivar street_address1: Street Address line 1. Required. + :vartype street_address1: str + :ivar street_address2: Street Address line 2. + :vartype street_address2: str + :ivar street_address3: Street Address line 3. + :vartype street_address3: str + :ivar city: Name of the City. + :vartype city: str + :ivar state_or_province: Name of the State or Province. + :vartype state_or_province: str + :ivar country: Name of the Country. Required. + :vartype country: str + :ivar postal_code: Postal code. + :vartype postal_code: str + :ivar zip_extended_code: Extended Zip Code. + :vartype zip_extended_code: str + :ivar company_name: Name of the company. + :vartype company_name: str + :ivar address_type: Type of address. Known values are: "None", "Residential", and "Commercial". + :vartype address_type: Union[str, "AddressType"] + :ivar skip_address_validation: Flag to indicate if customer has chosen to skip default address + validation. + :vartype skip_address_validation: bool + :ivar tax_identification_number: Tax Identification Number. + :vartype tax_identification_number: str + """ + + streetAddress1: Required[str] + """Street Address line 1. Required.""" + streetAddress2: str + """Street Address line 2.""" + streetAddress3: str + """Street Address line 3.""" + city: str + """Name of the City.""" + stateOrProvince: str + """Name of the State or Province.""" + country: Required[str] + """Name of the Country. Required.""" + postalCode: str + """Postal code.""" + zipExtendedCode: str + """Extended Zip Code.""" + companyName: str + """Name of the company.""" + addressType: Union[str, "AddressType"] + """Type of address. Known values are: \"None\", \"Residential\", and \"Commercial\".""" + skipAddressValidation: bool + """Flag to indicate if customer has chosen to skip default address validation.""" + taxIdentificationNumber: str + """Tax Identification Number.""" + + +class Sku(TypedDict, total=False): + """The Sku. + + :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", + and "DataBoxCustomerDisk". + :vartype name: Union[str, "SkuName"] + :ivar display_name: The display name of the sku. + :vartype display_name: str + :ivar family: The sku family. + :vartype family: str + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + """ + + name: Required[Union[str, "SkuName"]] + """The sku name. Required. Known values are: \"DataBox\", \"DataBoxDisk\", \"DataBoxHeavy\", and + \"DataBoxCustomerDisk\".""" + displayName: str + """The display name of the sku.""" + family: str + """The sku family.""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + + +class SkuAvailabilityValidationRequest(TypedDict, total=False): + """Request to validate sku availability. + + :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", + "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype device_type: Union[str, "SkuName"] + :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and + "ExportFromAzure". + :vartype transfer_type: Union[str, "TransferType"] + :ivar country: ISO country code. Country for hardware shipment. For codes check: + `https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + `_. + Required. + :vartype country: str + :ivar location: Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required. + :vartype location: str + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response of active job limit for sku availability. + :vartype validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY] + """ + + deviceType: Required[Union[str, "SkuName"]] + """Device type to be used for the job. Required. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + transferType: Required[Union[str, "TransferType"]] + """Type of the transfer. Required. Known values are: \"ImportToAzure\" and \"ExportFromAzure\".""" + country: Required[str] + """ISO country code. Country for hardware shipment. For codes check: + `https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + `_. + Required.""" + location: Required[str] + """Location for data transfer. For locations check: + `https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + `_. + Required.""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY]] + """Identifies the type of validation request. Required. Identify request and response of active + job limit for sku availability.""" + + +class SkuAvailabilityValidationResponseProperties(TypedDict, total=False): # pylint: disable=name-too-long + """Properties of sku availability validation response. + + :ivar error: Error code and message of validation response. + :vartype error: "CloudError" + :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and + "Skipped". + :vartype status: Union[str, "ValidationStatus"] + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response of active job limit for sku availability. + :vartype validation_type: Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY] + """ + + error: "CloudError" + """Error code and message of validation response.""" + status: Union[str, "ValidationStatus"] + """Sku availability validation status. Known values are: \"Valid\", \"Invalid\", and \"Skipped\".""" + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_SKU_AVAILABILITY]] + """Identifies the type of validation response. Required. Identify request and response of active + job limit for sku availability.""" + + +class SkuCapacity(TypedDict, total=False): + """Capacity of the sku. + + :ivar usable: Usable capacity in TB. + :vartype usable: str + :ivar maximum: Maximum capacity in TB. + :vartype maximum: str + :ivar individual_sku_usable: Maximum capacity per device in TB. + :vartype individual_sku_usable: str + """ + + usable: str + """Usable capacity in TB.""" + maximum: str + """Maximum capacity in TB.""" + individualSkuUsable: str + """Maximum capacity per device in TB.""" + + +class SkuCost(TypedDict, total=False): + """Describes metadata for retrieving price info. + + :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 + """ + + meterId: str + """Meter id of the Sku.""" + meterType: str + """The type of the meter.""" + multiplier: float + """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.""" + + +class SkuInformation(TypedDict, total=False): + """Information of the sku. + + :ivar sku: The Sku. + :vartype sku: "Sku" + :ivar enabled: The sku is enabled or not. + :vartype enabled: bool + :ivar properties: Properties of the sku. + :vartype properties: "SkuProperties" + """ + + sku: "Sku" + """The Sku.""" + enabled: bool + """The sku is enabled or not.""" + properties: "SkuProperties" + """Properties of the sku.""" + + +class SkuProperties(TypedDict, total=False): + """Properties of the sku. + + :ivar data_location_to_service_location_map: The map of data location to service location. + :vartype data_location_to_service_location_map: list["DataLocationToServiceLocationMap"] + :ivar capacity: Capacity of the Sku. + :vartype capacity: "SkuCapacity" + :ivar costs: Cost of the Sku. + :vartype costs: list["SkuCost"] + :ivar api_versions: Api versions that support this Sku. + :vartype api_versions: list[str] + :ivar disabled_reason: Reason why the Sku is disabled. Known values are: "None", "Country", + "Region", "Feature", "OfferType", and "NoSubscriptionInfo". + :vartype disabled_reason: Union[str, "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. + :vartype required_feature: str + :ivar countries_within_commerce_boundary: List of all the Countries in the SKU specific + commerce boundary. + :vartype countries_within_commerce_boundary: list[str] + """ + + dataLocationToServiceLocationMap: list["DataLocationToServiceLocationMap"] + """The map of data location to service location.""" + capacity: "SkuCapacity" + """Capacity of the Sku.""" + costs: list["SkuCost"] + """Cost of the Sku.""" + apiVersions: list[str] + """Api versions that support this Sku.""" + disabledReason: Union[str, "SkuDisabledReason"] + """Reason why the Sku is disabled. Known values are: \"None\", \"Country\", \"Region\", + \"Feature\", \"OfferType\", and \"NoSubscriptionInfo\".""" + disabledReasonMessage: str + """Message for why the Sku is disabled.""" + requiredFeature: str + """Required feature to access the sku.""" + countriesWithinCommerceBoundary: list[str] + """List of all the Countries in the SKU specific commerce boundary.""" + + +class StorageAccountDetails(TypedDict, total=False): + """Details for the storage account. + + :ivar 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 : @#\\-$%^!+=;:_()]+. + :vartype share_password: str + :ivar storage_account_id: Storage Account Resource Id. Required. + :vartype storage_account_id: str + :ivar data_account_type: Account Type of the data to be transferred. Required. Storage Accounts + . + :vartype data_account_type: Literal[DataAccountType.STORAGE_ACCOUNT] + """ + + sharePassword: str + """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 : @#\\-$%^!+=;:_()]+.""" + storageAccountId: Required[str] + """Storage Account Resource Id. Required.""" + dataAccountType: Required[Literal[DataAccountType.STORAGE_ACCOUNT]] + """Account Type of the data to be transferred. Required. Storage Accounts .""" + + +class SubscriptionIsAllowedToCreateJobValidationRequest(TypedDict, total=False): # pylint: disable=name-too-long + """Request to validate subscription permission to create jobs. + + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response for validation of subscription permission to create job. + :vartype validation_type: + Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB] + """ + + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB]] + """Identifies the type of validation request. Required. Identify request and response for + validation of subscription permission to create job.""" + + +class SubscriptionIsAllowedToCreateJobValidationResponseProperties( + TypedDict, total=False +): # pylint: disable=name-too-long + """Properties of subscription permission to create job validation response. + + :ivar error: Error code and message of validation response. + :vartype error: "CloudError" + :ivar status: Validation status of subscription permission to create job. Known values are: + "Valid", "Invalid", and "Skipped". + :vartype status: Union[str, "ValidationStatus"] + :ivar validation_type: Identifies the type of validation response. Required. Identify request + and response for validation of subscription permission to create job. + :vartype validation_type: + Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB] + """ + + error: "CloudError" + """Error code and message of validation response.""" + status: Union[str, "ValidationStatus"] + """Validation status of subscription permission to create job. Known values are: \"Valid\", + \"Invalid\", and \"Skipped\".""" + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB]] + """Identifies the type of validation response. Required. Identify request and response for + validation of subscription permission to create job.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: Union[str, "CreatedByType"] + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: str + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: Union[str, "CreatedByType"] + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class TransferAllDetails(TypedDict, total=False): + """Details to transfer all data. + + :ivar data_account_type: Type of the account of data. Required. Known values are: + "StorageAccount" and "ManagedDisk". + :vartype data_account_type: Union[str, "DataAccountType"] + :ivar transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :vartype transfer_all_blobs: bool + :ivar transfer_all_files: To indicate if all Azure Files have to be transferred. + :vartype transfer_all_files: bool + """ + + dataAccountType: Required[Union[str, "DataAccountType"]] + """Type of the account of data. Required. Known values are: \"StorageAccount\" and + \"ManagedDisk\".""" + transferAllBlobs: bool + """To indicate if all Azure blobs have to be transferred.""" + transferAllFiles: bool + """To indicate if all Azure Files have to be transferred.""" + + +class TransferConfiguration(TypedDict, total=False): + """Configuration for defining the transfer of data. + + :ivar transfer_configuration_type: Type of the configuration for transfer. Required. Known + values are: "TransferAll" and "TransferUsingFilter". + :vartype transfer_configuration_type: Union[str, "TransferConfigurationType"] + :ivar transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :vartype transfer_filter_details: "TransferConfigurationTransferFilterDetails" + :ivar 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. + :vartype transfer_all_details: "TransferConfigurationTransferAllDetails" + """ + + transferConfigurationType: Required[Union[str, "TransferConfigurationType"]] + """Type of the configuration for transfer. Required. Known values are: \"TransferAll\" and + \"TransferUsingFilter\".""" + transferFilterDetails: "TransferConfigurationTransferFilterDetails" + """Map of filter type and the details to filter. This field is required only if the + TransferConfigurationType is given as TransferUsingFilter.""" + transferAllDetails: "TransferConfigurationTransferAllDetails" + """Map of filter type and the details to transfer all data. This field is required only if the + TransferConfigurationType is given as TransferAll.""" + + +class TransferConfigurationTransferAllDetails(TypedDict, total=False): + """Map of filter type and the details to transfer all data. This field is required only if the + TransferConfigurationType is given as TransferAll. + + :ivar include: Details to transfer all data. + :vartype include: "TransferAllDetails" + """ + + include: "TransferAllDetails" + """Details to transfer all data.""" + + +class TransferConfigurationTransferFilterDetails(TypedDict, total=False): # pylint: disable=name-too-long + """Map of filter type and the details to filter. This field is required only if the + TransferConfigurationType is given as TransferUsingFilter. + + :ivar include: Details of the filtering the transfer of data. + :vartype include: "TransferFilterDetails" + """ + + include: "TransferFilterDetails" + """Details of the filtering the transfer of data.""" + + +class TransferFilterDetails(TypedDict, total=False): + """Details of the filtering the transfer of data. + + :ivar data_account_type: Type of the account of data. Required. Known values are: + "StorageAccount" and "ManagedDisk". + :vartype data_account_type: Union[str, "DataAccountType"] + :ivar blob_filter_details: Filter details to transfer blobs. + :vartype blob_filter_details: "BlobFilterDetails" + :ivar azure_file_filter_details: Filter details to transfer Azure files. + :vartype azure_file_filter_details: "AzureFileFilterDetails" + :ivar filter_file_details: Details of the filter files to be used for data transfer. + :vartype filter_file_details: list["FilterFileDetails"] + """ + + dataAccountType: Required[Union[str, "DataAccountType"]] + """Type of the account of data. Required. Known values are: \"StorageAccount\" and + \"ManagedDisk\".""" + blobFilterDetails: "BlobFilterDetails" + """Filter details to transfer blobs.""" + azureFileFilterDetails: "AzureFileFilterDetails" + """Filter details to transfer Azure files.""" + filterFileDetails: list["FilterFileDetails"] + """Details of the filter files to be used for data transfer.""" + + +class TransportAvailabilityDetails(TypedDict, total=False): + """Transport options availability details for given region. + + :ivar shipment_type: Transport Shipment Type supported for given region. Known values are: + "CustomerManaged" and "MicrosoftManaged". + :vartype shipment_type: Union[str, "TransportShipmentTypes"] + """ + + shipmentType: Union[str, "TransportShipmentTypes"] + """Transport Shipment Type supported for given region. Known values are: \"CustomerManaged\" and + \"MicrosoftManaged\".""" + + +class TransportAvailabilityRequest(TypedDict, total=False): + """Request body to get the transport availability for given sku. + + :ivar sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", + and "DataBoxCustomerDisk". + :vartype sku_name: Union[str, "SkuName"] + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + """ + + skuName: Union[str, "SkuName"] + """Type of the device. Known values are: \"DataBox\", \"DataBoxDisk\", \"DataBoxHeavy\", and + \"DataBoxCustomerDisk\".""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + + +class TransportAvailabilityResponse(TypedDict, total=False): + """Transport options available for given sku in a region. + + :ivar transport_availability_details: List of transport availability details for given region. + :vartype transport_availability_details: list["TransportAvailabilityDetails"] + """ + + transportAvailabilityDetails: list["TransportAvailabilityDetails"] + """List of transport availability details for given region.""" + + +class TransportPreferences(TypedDict, total=False): + """Preferences related to the shipment logistics of the sku. + + :ivar preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. + Required. Known values are: "CustomerManaged" and "MicrosoftManaged". + :vartype preferred_shipment_type: Union[str, "TransportShipmentTypes"] + :ivar is_updated: Read only property which indicates whether transport preferences has been + updated or not after device is prepared. + :vartype is_updated: bool + """ + + preferredShipmentType: Required[Union[str, "TransportShipmentTypes"]] + """Indicates Shipment Logistics type that the customer preferred. Required. Known values are: + \"CustomerManaged\" and \"MicrosoftManaged\".""" + isUpdated: bool + """Read only property which indicates whether transport preferences has been updated or not after + device is prepared.""" + + +class UnencryptedCredentials(TypedDict, total=False): + """Unencrypted credentials for accessing device. + + :ivar job_name: Name of the job. + :vartype job_name: str + :ivar job_secrets: Secrets related to this job. + :vartype job_secrets: "JobSecrets" + """ + + jobName: str + """Name of the job.""" + jobSecrets: "JobSecrets" + """Secrets related to this job.""" + + +class UpdateJobDetails(TypedDict, total=False): + """Job details for update. + + :ivar contact_details: Contact details for notification and shipping. + :vartype contact_details: "ContactDetails" + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: "ShippingAddress" + :ivar reverse_shipping_details: Reverse Shipping Address and contact details for a job. + :vartype reverse_shipping_details: "ReverseShippingDetails" + :ivar preferences: Preferences related to the order. + :vartype preferences: "Preferences" + :ivar key_encryption_key: Key encryption key for the job. + :vartype key_encryption_key: "KeyEncryptionKey" + :ivar return_to_customer_package_details: Return package details of job. + :vartype return_to_customer_package_details: "PackageCarrierDetails" + """ + + contactDetails: "ContactDetails" + """Contact details for notification and shipping.""" + shippingAddress: "ShippingAddress" + """Shipping address of the customer.""" + reverseShippingDetails: "ReverseShippingDetails" + """Reverse Shipping Address and contact details for a job.""" + preferences: "Preferences" + """Preferences related to the order.""" + keyEncryptionKey: "KeyEncryptionKey" + """Key encryption key for the job.""" + returnToCustomerPackageDetails: "PackageCarrierDetails" + """Return package details of job.""" + + +class UpdateJobProperties(TypedDict, total=False): + """Job Properties for update. + + :ivar details: Details of a job to be updated. + :vartype details: "UpdateJobDetails" + """ + + details: "UpdateJobDetails" + """Details of a job to be updated.""" + + +class UserAssignedIdentity(TypedDict, total=False): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principalId: str + """The principal ID of the assigned identity.""" + clientId: str + """The client ID of the assigned identity.""" + + +class UserAssignedProperties(TypedDict, total=False): + """User assigned identity properties. + + :ivar resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :vartype resource_id: str + """ + + resourceId: str + """Arm resource id for user assigned identity to be used to fetch MSI token.""" + + +class ValidateAddress(TypedDict, total=False): + """The requirements to validate customer address where the device needs to be shipped. + + :ivar shipping_address: Shipping address of the customer. Required. + :vartype shipping_address: "ShippingAddress" + :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", + "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". + :vartype device_type: Union[str, "SkuName"] + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: "TransportPreferences" + :ivar model: The customer friendly name of the combination of version and capacity of the + device. This field is necessary only at the time of ordering the newer generation device i.e. + AzureDataBox120 and AzureDataBox525 as of Feb/2025. Known values are: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk", "AzureDataBox120", and "AzureDataBox525". + :vartype model: Union[str, "ModelName"] + :ivar validation_type: Identifies the type of validation request. Required. Identify request + and response of address validation. + :vartype validation_type: Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS] + """ + + shippingAddress: Required["ShippingAddress"] + """Shipping address of the customer. Required.""" + deviceType: Required[Union[str, "SkuName"]] + """Device type to be used for the job. Required. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", and \"DataBoxCustomerDisk\".""" + transportPreferences: "TransportPreferences" + """Preferences related to the shipment logistics of the sku.""" + model: Union[str, "ModelName"] + """The customer friendly name of the combination of version and capacity of the device. This field + is necessary only at the time of ordering the newer generation device i.e. AzureDataBox120 and + AzureDataBox525 as of Feb/2025. Known values are: \"DataBox\", \"DataBoxDisk\", + \"DataBoxHeavy\", \"DataBoxCustomerDisk\", \"AzureDataBox120\", and \"AzureDataBox525\".""" + validationType: Required[Literal[ValidationInputDiscriminator.VALIDATE_ADDRESS]] + """Identifies the type of validation request. Required. Identify request and response of address + validation.""" + + +class ValidationResponse(TypedDict, total=False): + """Response of pre job creation validations. + + :ivar properties: Properties of pre job creation validation response. + :vartype properties: "ValidationResponseProperties" + """ + + properties: "ValidationResponseProperties" + """Properties of pre job creation validation response.""" + + +class ValidationResponseProperties(TypedDict, total=False): + """Properties of pre job creation validation response. + + :ivar status: Overall validation status. Known values are: "AllValidToProceed", + "InputsRevisitRequired", and "CertainInputValidationsSkipped". + :vartype status: Union[str, "OverallValidationStatus"] + :ivar individual_response_details: List of response details contain validationType and its + response as key and value respectively. + :vartype individual_response_details: list["ValidationInputResponse"] + """ + + status: Union[str, "OverallValidationStatus"] + """Overall validation status. Known values are: \"AllValidToProceed\", \"InputsRevisitRequired\", + and \"CertainInputValidationsSkipped\".""" + individualResponseDetails: list["ValidationInputResponse"] + """List of response details contain validationType and its response as key and value respectively.""" + + +ValidationInputResponse = Union[ + AddressValidationProperties, + CreateOrderLimitForSubscriptionValidationResponseProperties, + DataTransferDetailsValidationResponseProperties, + PreferencesValidationResponseProperties, + SkuAvailabilityValidationResponseProperties, + SubscriptionIsAllowedToCreateJobValidationResponseProperties, +] +CopyLogDetails = Union[ + DataBoxAccountCopyLogDetails, + DataBoxCustomerDiskCopyLogDetails, + DataBoxDiskCopyLogDetails, + DataBoxHeavyAccountCopyLogDetails, +] +ValidationRequest = Union[CreateJobValidations] +ValidationInputRequest = Union[ + ValidateAddress, + CreateOrderLimitForSubscriptionValidationRequest, + DataTransferDetailsValidationRequest, + PreferencesValidationRequest, + SkuAvailabilityValidationRequest, + SubscriptionIsAllowedToCreateJobValidationRequest, +] +JobSecrets = Union[DataboxJobSecrets, CustomerDiskJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets] +DataAccountDetails = Union[ManagedDiskDetails, StorageAccountDetails] +JobDetails = Union[DataBoxJobDetails, DataBoxCustomerDiskJobDetails, DataBoxDiskJobDetails, DataBoxHeavyJobDetails] +GranularCopyLogDetails = Union[DataBoxDiskGranularCopyLogDetails] +ScheduleAvailabilityRequest = Union[ + DataBoxScheduleAvailabilityRequest, DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest +] +DatacenterAddressResponse = Union[DatacenterAddressInstructionResponse, DatacenterAddressLocationResponse] diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/available_skus_post.py b/sdk/databox/azure-mgmt-databox/generated_samples/available_skus_post.py index 501f22211e34..ba8bb6ec858e 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/available_skus_post.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/available_skus_post.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.service.list_available_skus_by_resource_group( @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/AvailableSkusPost.json +# x-ms-original-file: 2025-07-01/AvailableSkusPost.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/book_shipment_pickup_post.py b/sdk/databox/azure-mgmt-databox/generated_samples/book_shipment_pickup_post.py index 9f07c04b815d..79b525e79a41 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/book_shipment_pickup_post.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/book_shipment_pickup_post.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.book_shipment_pick_up( @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/BookShipmentPickupPost.json +# x-ms-original-file: 2025-07-01/BookShipmentPickupPost.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/job_mitigate.py b/sdk/databox/azure-mgmt-databox/generated_samples/job_mitigate.py index e64ebfd12f25..8aa0e7eaacd9 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/job_mitigate.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/job_mitigate.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) client.mitigate( @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobMitigate.json +# x-ms-original-file: 2025-07-01/JobMitigate.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_cancel_post.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_cancel_post.py index aca2871898cf..66555b9e8c5b 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_cancel_post.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_cancel_post.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) client.jobs.cancel( @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsCancelPost.json +# x-ms-original-file: 2025-07-01/JobsCancelPost.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create.py index 08da28269e0b..6399941f3bfb 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create.py @@ -1,8 +1,9 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +28,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.begin_create( @@ -71,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsCreate.json +# x-ms-original-file: 2025-07-01/JobsCreate.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_device_password.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_device_password.py index 5083d6b96306..1dbbeecf91ce 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_device_password.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_device_password.py @@ -1,8 +1,9 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +28,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.begin_create( @@ -73,6 +74,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsCreateDevicePassword.json +# x-ms-original-file: 2025-07-01/JobsCreateDevicePassword.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_double_encryption.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_double_encryption.py index be062a2fa2b1..4df1af76683e 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_double_encryption.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_double_encryption.py @@ -1,8 +1,9 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +28,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.begin_create( @@ -72,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsCreateDoubleEncryption.json +# x-ms-original-file: 2025-07-01/JobsCreateDoubleEncryption.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_export.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_export.py index 0f350476496b..a12814d5776e 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_export.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_export.py @@ -1,8 +1,9 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +28,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.begin_create( @@ -81,6 +82,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsCreateExport.json +# x-ms-original-file: 2025-07-01/JobsCreateExport.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_with_user_assigned_identity.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_with_user_assigned_identity.py index 4f4b2129491b..9bceedf48131 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_with_user_assigned_identity.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create_with_user_assigned_identity.py @@ -1,8 +1,9 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +28,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.begin_create( @@ -77,6 +78,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsCreateWithUserAssignedIdentity.json +# x-ms-original-file: 2025-07-01/JobsCreateWithUserAssignedIdentity.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_delete.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_delete.py index 21d73389f8f4..bc08efde2108 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_delete.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_delete.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) client.jobs.begin_delete( @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsDelete.json +# x-ms-original-file: 2025-07-01/JobsDelete.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get.py index 9f0c6dbae06e..cd026d74c871 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsGet.json +# x-ms-original-file: 2025-07-01/JobsGet.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_cmk.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_cmk.py index 9684c241f7bf..56f5ecee9fff 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_cmk.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_cmk.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsGetCmk.json +# x-ms-original-file: 2025-07-01/JobsGetCmk.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_copy_stuck.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_copy_stuck.py index f026243f5ed4..ccf32b4cd8ec 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_copy_stuck.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_copy_stuck.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsGetCopyStuck.json +# x-ms-original-file: 2025-07-01/JobsGetCopyStuck.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_export.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_export.py index 8303c9c69b38..c20209bafbb5 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_export.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_export.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsGetExport.json +# x-ms-original-file: 2025-07-01/JobsGetExport.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_waiting_for_action.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_waiting_for_action.py index a8d05f85d7a6..c29f4c8e3f6e 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_waiting_for_action.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get_waiting_for_action.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsGetWaitingForAction.json +# x-ms-original-file: 2025-07-01/JobsGetWaitingForAction.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list.py index 66ef6cb2f17d..91c15e46ec91 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.list() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsList.json +# x-ms-original-file: 2025-07-01/JobsList.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list_by_resource_group.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list_by_resource_group.py index 250d500f1898..6d85f11edab0 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list_by_resource_group.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list_by_resource_group.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.list_by_resource_group( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsListByResourceGroup.json +# x-ms-original-file: 2025-07-01/JobsListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list_credentials.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list_credentials.py index a6a5a743c571..5ff95bee67fe 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list_credentials.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list_credentials.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.list_credentials( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsListCredentials.json +# x-ms-original-file: 2025-07-01/JobsListCredentials.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch.py index 3d7415c2fe85..e563911c28f1 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.begin_update( @@ -59,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsPatch.json +# x-ms-original-file: 2025-07-01/JobsPatch.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch_cmk.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch_cmk.py index e94335e8dafb..b2075a73368e 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch_cmk.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch_cmk.py @@ -1,8 +1,9 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +28,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.begin_update( @@ -48,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsPatchCmk.json +# x-ms-original-file: 2025-07-01/JobsPatchCmk.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch_system_assigned_to_user_assigned.py b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch_system_assigned_to_user_assigned.py index bbfc30e9f00c..7ba4dfda0053 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch_system_assigned_to_user_assigned.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch_system_assigned_to_user_assigned.py @@ -1,8 +1,9 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +28,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.begin_update( @@ -60,6 +61,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/JobsPatchSystemAssignedToUserAssigned.json +# x-ms-original-file: 2025-07-01/JobsPatchSystemAssignedToUserAssigned.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/mark_devices_shipped.py b/sdk/databox/azure-mgmt-databox/generated_samples/mark_devices_shipped.py index 709112682fca..8fc226a7d27a 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/mark_devices_shipped.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/mark_devices_shipped.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) client.jobs.mark_devices_shipped( @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/MarkDevicesShipped.json +# x-ms-original-file: 2025-07-01/MarkDevicesShipped.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/operations_get.py b/sdk/databox/azure-mgmt-databox/generated_samples/operations_get.py index ac96c488caf8..878bbe526e07 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/operations_get.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/operations_get.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/OperationsGet.json +# x-ms-original-file: 2025-07-01/OperationsGet.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/region_configuration.py b/sdk/databox/azure-mgmt-databox/generated_samples/region_configuration.py index f0ff6a4d167e..3cec72b2aee7 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/region_configuration.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/region_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.service.region_configuration( @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/RegionConfiguration.json +# x-ms-original-file: 2025-07-01/RegionConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/region_configuration_by_resource_group.py b/sdk/databox/azure-mgmt-databox/generated_samples/region_configuration_by_resource_group.py index 4322a5715157..5fd00257f6dc 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/region_configuration_by_resource_group.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/region_configuration_by_resource_group.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.service.region_configuration_by_resource_group( @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/RegionConfigurationByResourceGroup.json +# x-ms-original-file: 2025-07-01/RegionConfigurationByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/validate_address_post.py b/sdk/databox/azure-mgmt-databox/generated_samples/validate_address_post.py index 7d3a034b7c0d..07b09f36fb98 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/validate_address_post.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/validate_address_post.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.service.validate_address( @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/ValidateAddressPost.json +# x-ms-original-file: 2025-07-01/ValidateAddressPost.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/validate_inputs.py b/sdk/databox/azure-mgmt-databox/generated_samples/validate_inputs.py index 013daaf6d5f3..2a324083062a 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/validate_inputs.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/validate_inputs.py @@ -1,8 +1,9 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +28,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.service.validate_inputs( @@ -87,6 +88,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/ValidateInputs.json +# x-ms-original-file: 2025-07-01/ValidateInputs.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_samples/validate_inputs_by_resource_group.py b/sdk/databox/azure-mgmt-databox/generated_samples/validate_inputs_by_resource_group.py index b2d8f6fa88ca..3803b8440220 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/validate_inputs_by_resource_group.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/validate_inputs_by_resource_group.py @@ -1,8 +1,9 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +28,7 @@ def main(): client = DataBoxManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) response = client.service.validate_inputs_by_resource_group( @@ -88,6 +89,6 @@ def main(): print(response) -# x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2025-02-01/examples/ValidateInputsByResourceGroup.json +# x-ms-original-file: 2025-07-01/ValidateInputsByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/databox/azure-mgmt-databox/generated_tests/conftest.py b/sdk/databox/azure-mgmt-databox/generated_tests/conftest.py index 01886a327895..a312a677eb3c 100644 --- a/sdk/databox/azure-mgmt-databox/generated_tests/conftest.py +++ b/sdk/databox/azure-mgmt-databox/generated_tests/conftest.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import os diff --git a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management.py b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management.py index cd535f1a026a..49a99c9de486 100644 --- a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management.py +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -25,7 +25,6 @@ def test_mitigate(self, resource_group): job_name="str", resource_group_name=resource_group.name, mitigate_job_request={"customerResolutionCode": "str", "serialNumberCustomerResolutionMap": {"str": "str"}}, - api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_async.py b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_async.py index ba5a1d2d21e3..378b692862f5 100644 --- a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_async.py +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -26,7 +26,6 @@ async def test_mitigate(self, resource_group): job_name="str", resource_group_name=resource_group.name, mitigate_job_request={"customerResolutionCode": "str", "serialNumberCustomerResolutionMap": {"str": "str"}}, - api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations.py b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations.py index 3b1b4b08647c..cedf6bad6150 100644 --- a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations.py +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,47 +18,12 @@ class TestDataBoxManagementJobsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(DataBoxManagementClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_jobs_list(self, resource_group): - response = self.client.jobs.list( - api_version="2025-02-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_jobs_mark_devices_shipped(self, resource_group): - response = self.client.jobs.mark_devices_shipped( - job_name="str", - resource_group_name=resource_group.name, - mark_devices_shipped_request={"deliverToDcPackageDetails": {"carrierName": "str", "trackingId": "str"}}, - api_version="2025-02-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_jobs_list_by_resource_group(self, resource_group): - response = self.client.jobs.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-02-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_jobs_get(self, resource_group): response = self.client.jobs.get( resource_group_name=resource_group.name, job_name="str", - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -72,38 +37,40 @@ def test_jobs_begin_create(self, resource_group): job_name="str", job_resource={ "location": "str", - "sku": {"name": "str", "displayName": "str", "family": "str", "model": "str"}, - "transferType": "str", - "allDevicesLost": bool, - "cancellationReason": "str", - "delayedStage": "str", - "deliveryInfo": {"scheduledDateTime": "2020-02-20 00:00:00"}, - "deliveryType": "NonScheduled", - "details": "job_details", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", + "properties": { + "transferType": "str", + "allDevicesLost": bool, + "cancellationReason": "str", + "delayedStage": "str", + "deliveryInfo": {"scheduledDateTime": "2020-02-20 00:00:00"}, + "deliveryType": "str", + "details": "job_details", + "error": { + "additionalInfo": [{"info": {"str": {}}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + }, + "isCancellable": bool, + "isCancellableWithoutFee": bool, + "isDeletable": bool, + "isPrepareToShipEnabled": bool, + "isShippingAddressEditable": bool, + "reverseShippingDetailsUpdate": "str", + "reverseTransportPreferenceUpdate": "str", + "startTime": "2020-02-20 00:00:00", + "status": "str", }, + "sku": {"name": "str", "displayName": "str", "family": "str", "model": "str"}, "id": "str", "identity": { "principalId": "str", "tenantId": "str", - "type": "None", + "type": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - "isCancellable": bool, - "isCancellableWithoutFee": bool, - "isDeletable": bool, - "isPrepareToShipEnabled": bool, - "isShippingAddressEditable": bool, "name": "str", - "reverseShippingDetailsUpdate": "str", - "reverseTransportPreferenceUpdate": "str", - "startTime": "2020-02-20 00:00:00", - "status": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -115,19 +82,6 @@ def test_jobs_begin_create(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2025-02-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_jobs_begin_delete(self, resource_group): - response = self.client.jobs.begin_delete( - resource_group_name=resource_group.name, - job_name="str", - api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -140,45 +94,67 @@ def test_jobs_begin_update(self, resource_group): resource_group_name=resource_group.name, job_name="str", job_resource_update_parameter={ - "details": { - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "notificationPreference": [{"sendNotification": True, "stageName": "str"}], - "phoneExtension": "str", - }, - "keyEncryptionKey": { - "kekType": "MicrosoftManaged", - "identityProperties": {"type": "str", "userAssigned": {"resourceId": "str"}}, - "kekUrl": "str", - "kekVaultResourceID": "str", - }, - "preferences": { - "encryptionPreferences": {"doubleEncryption": "Disabled", "hardwareEncryption": "str"}, - "preferredDataCenterRegion": ["str"], - "reverseTransportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, - "storageAccountAccessTierPreferences": ["Archive"], - "transportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, - }, - "returnToCustomerPackageDetails": { - "carrierAccountNumber": "str", - "carrierName": "str", - "trackingId": "str", - }, - "reverseShippingDetails": { + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "details": { "contactDetails": { "contactName": "str", + "emailList": ["str"], "phone": "str", "mobile": "str", + "notificationPreference": [{"sendNotification": bool, "stageName": "str"}], "phoneExtension": "str", }, - "isUpdated": bool, + "keyEncryptionKey": { + "kekType": "str", + "identityProperties": {"type": "str", "userAssigned": {"resourceId": "str"}}, + "kekUrl": "str", + "kekVaultResourceID": "str", + }, + "preferences": { + "encryptionPreferences": {"doubleEncryption": "str", "hardwareEncryption": "str"}, + "preferredDataCenterRegion": ["str"], + "reverseTransportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, + "storageAccountAccessTierPreferences": ["Archive"], + "transportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, + }, + "returnToCustomerPackageDetails": { + "carrierAccountNumber": "str", + "carrierName": "str", + "trackingId": "str", + }, + "reverseShippingDetails": { + "contactDetails": { + "contactName": "str", + "phone": "str", + "mobile": "str", + "phoneExtension": "str", + }, + "isUpdated": bool, + "shippingAddress": { + "country": "str", + "streetAddress1": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "skipAddressValidation": bool, + "stateOrProvince": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "taxIdentificationNumber": "str", + "zipExtendedCode": "str", + }, + }, "shippingAddress": { "country": "str", "streetAddress1": "str", - "addressType": "None", + "addressType": "str", "city": "str", "companyName": "str", "postalCode": "str", @@ -189,36 +165,44 @@ def test_jobs_begin_update(self, resource_group): "taxIdentificationNumber": "str", "zipExtendedCode": "str", }, - }, - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "None", - "city": "str", - "companyName": "str", - "postalCode": "str", - "skipAddressValidation": bool, - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "taxIdentificationNumber": "str", - "zipExtendedCode": "str", - }, - }, - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "None", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + } }, "tags": {"str": "str"}, }, - api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_jobs_begin_delete(self, resource_group): + response = self.client.jobs.begin_delete( + resource_group_name=resource_group.name, + job_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_jobs_list_by_resource_group(self, resource_group): + response = self.client.jobs.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_jobs_list(self, resource_group): + response = self.client.jobs.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_jobs_book_shipment_pick_up(self, resource_group): @@ -230,7 +214,6 @@ def test_jobs_book_shipment_pick_up(self, resource_group): "shipmentLocation": "str", "startTime": "2020-02-20 00:00:00", }, - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -243,7 +226,6 @@ def test_jobs_cancel(self, resource_group): resource_group_name=resource_group.name, job_name="str", cancellation_reason={"reason": "str"}, - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -255,8 +237,19 @@ def test_jobs_list_credentials(self, resource_group): response = self.client.jobs.list_credentials( resource_group_name=resource_group.name, job_name="str", - api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_jobs_mark_devices_shipped(self, resource_group): + response = self.client.jobs.mark_devices_shipped( + job_name="str", + resource_group_name=resource_group.name, + mark_devices_shipped_request={"deliverToDcPackageDetails": {"carrierName": "str", "trackingId": "str"}}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations_async.py b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations_async.py index be9ac8f08bc6..78b00094986e 100644 --- a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations_async.py +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,47 +19,12 @@ class TestDataBoxManagementJobsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(DataBoxManagementClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_jobs_list(self, resource_group): - response = self.client.jobs.list( - api_version="2025-02-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_jobs_mark_devices_shipped(self, resource_group): - response = await self.client.jobs.mark_devices_shipped( - job_name="str", - resource_group_name=resource_group.name, - mark_devices_shipped_request={"deliverToDcPackageDetails": {"carrierName": "str", "trackingId": "str"}}, - api_version="2025-02-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_jobs_list_by_resource_group(self, resource_group): - response = self.client.jobs.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-02-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_jobs_get(self, resource_group): response = await self.client.jobs.get( resource_group_name=resource_group.name, job_name="str", - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -74,38 +39,40 @@ async def test_jobs_begin_create(self, resource_group): job_name="str", job_resource={ "location": "str", - "sku": {"name": "str", "displayName": "str", "family": "str", "model": "str"}, - "transferType": "str", - "allDevicesLost": bool, - "cancellationReason": "str", - "delayedStage": "str", - "deliveryInfo": {"scheduledDateTime": "2020-02-20 00:00:00"}, - "deliveryType": "NonScheduled", - "details": "job_details", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", + "properties": { + "transferType": "str", + "allDevicesLost": bool, + "cancellationReason": "str", + "delayedStage": "str", + "deliveryInfo": {"scheduledDateTime": "2020-02-20 00:00:00"}, + "deliveryType": "str", + "details": "job_details", + "error": { + "additionalInfo": [{"info": {"str": {}}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + }, + "isCancellable": bool, + "isCancellableWithoutFee": bool, + "isDeletable": bool, + "isPrepareToShipEnabled": bool, + "isShippingAddressEditable": bool, + "reverseShippingDetailsUpdate": "str", + "reverseTransportPreferenceUpdate": "str", + "startTime": "2020-02-20 00:00:00", + "status": "str", }, + "sku": {"name": "str", "displayName": "str", "family": "str", "model": "str"}, "id": "str", "identity": { "principalId": "str", "tenantId": "str", - "type": "None", + "type": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - "isCancellable": bool, - "isCancellableWithoutFee": bool, - "isDeletable": bool, - "isPrepareToShipEnabled": bool, - "isShippingAddressEditable": bool, "name": "str", - "reverseShippingDetailsUpdate": "str", - "reverseTransportPreferenceUpdate": "str", - "startTime": "2020-02-20 00:00:00", - "status": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -117,21 +84,6 @@ async def test_jobs_begin_create(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2025-02-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_jobs_begin_delete(self, resource_group): - response = await ( - await self.client.jobs.begin_delete( - resource_group_name=resource_group.name, - job_name="str", - api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result @@ -146,45 +98,67 @@ async def test_jobs_begin_update(self, resource_group): resource_group_name=resource_group.name, job_name="str", job_resource_update_parameter={ - "details": { - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "notificationPreference": [{"sendNotification": True, "stageName": "str"}], - "phoneExtension": "str", - }, - "keyEncryptionKey": { - "kekType": "MicrosoftManaged", - "identityProperties": {"type": "str", "userAssigned": {"resourceId": "str"}}, - "kekUrl": "str", - "kekVaultResourceID": "str", - }, - "preferences": { - "encryptionPreferences": {"doubleEncryption": "Disabled", "hardwareEncryption": "str"}, - "preferredDataCenterRegion": ["str"], - "reverseTransportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, - "storageAccountAccessTierPreferences": ["Archive"], - "transportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, - }, - "returnToCustomerPackageDetails": { - "carrierAccountNumber": "str", - "carrierName": "str", - "trackingId": "str", - }, - "reverseShippingDetails": { + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "details": { "contactDetails": { "contactName": "str", + "emailList": ["str"], "phone": "str", "mobile": "str", + "notificationPreference": [{"sendNotification": bool, "stageName": "str"}], "phoneExtension": "str", }, - "isUpdated": bool, + "keyEncryptionKey": { + "kekType": "str", + "identityProperties": {"type": "str", "userAssigned": {"resourceId": "str"}}, + "kekUrl": "str", + "kekVaultResourceID": "str", + }, + "preferences": { + "encryptionPreferences": {"doubleEncryption": "str", "hardwareEncryption": "str"}, + "preferredDataCenterRegion": ["str"], + "reverseTransportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, + "storageAccountAccessTierPreferences": ["Archive"], + "transportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, + }, + "returnToCustomerPackageDetails": { + "carrierAccountNumber": "str", + "carrierName": "str", + "trackingId": "str", + }, + "reverseShippingDetails": { + "contactDetails": { + "contactName": "str", + "phone": "str", + "mobile": "str", + "phoneExtension": "str", + }, + "isUpdated": bool, + "shippingAddress": { + "country": "str", + "streetAddress1": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "skipAddressValidation": bool, + "stateOrProvince": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "taxIdentificationNumber": "str", + "zipExtendedCode": "str", + }, + }, "shippingAddress": { "country": "str", "streetAddress1": "str", - "addressType": "None", + "addressType": "str", "city": "str", "companyName": "str", "postalCode": "str", @@ -195,37 +169,47 @@ async def test_jobs_begin_update(self, resource_group): "taxIdentificationNumber": "str", "zipExtendedCode": "str", }, - }, - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "None", - "city": "str", - "companyName": "str", - "postalCode": "str", - "skipAddressValidation": bool, - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "taxIdentificationNumber": "str", - "zipExtendedCode": "str", - }, - }, - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "None", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + } }, "tags": {"str": "str"}, }, - api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_jobs_begin_delete(self, resource_group): + response = await ( + await self.client.jobs.begin_delete( + resource_group_name=resource_group.name, + job_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_jobs_list_by_resource_group(self, resource_group): + response = self.client.jobs.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_jobs_list(self, resource_group): + response = self.client.jobs.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_jobs_book_shipment_pick_up(self, resource_group): @@ -237,7 +221,6 @@ async def test_jobs_book_shipment_pick_up(self, resource_group): "shipmentLocation": "str", "startTime": "2020-02-20 00:00:00", }, - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -250,7 +233,6 @@ async def test_jobs_cancel(self, resource_group): resource_group_name=resource_group.name, job_name="str", cancellation_reason={"reason": "str"}, - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -262,8 +244,19 @@ async def test_jobs_list_credentials(self, resource_group): response = self.client.jobs.list_credentials( resource_group_name=resource_group.name, job_name="str", - api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_jobs_mark_devices_shipped(self, resource_group): + response = await self.client.jobs.mark_devices_shipped( + job_name="str", + resource_group_name=resource_group.name, + mark_devices_shipped_request={"deliverToDcPackageDetails": {"carrierName": "str", "trackingId": "str"}}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations.py b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations.py index c15360974786..da7c6aa9c99d 100644 --- a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations.py +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,9 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_operations_list(self, resource_group): - response = self.client.operations.list( - api_version="2025-02-01", - ) + response = self.client.operations.list() result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations_async.py b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations_async.py index bf1b8fd87127..d898b1e31365 100644 --- a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations_async.py +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -22,9 +22,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_operations_list(self, resource_group): - response = self.client.operations.list( - api_version="2025-02-01", - ) + response = self.client.operations.list() result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations.py b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations.py index 45498cddde95..f79e031e9292 100644 --- a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations.py +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,14 +20,17 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_service_list_available_skus_by_resource_group(self, resource_group): - response = self.client.service.list_available_skus_by_resource_group( - resource_group_name=resource_group.name, + def test_service_region_configuration(self, resource_group): + response = self.client.service.region_configuration( location="str", - available_sku_request={"country": "str", "location": "str", "transferType": "str", "skuNames": ["str"]}, - api_version="2025-02-01", + region_configuration_request={ + "datacenterAddressRequest": {"skuName": "str", "storageLocation": "str", "model": "str"}, + "deviceCapabilityRequest": {"model": "str", "skuName": "str"}, + "scheduleAvailabilityRequest": "schedule_availability_request", + "transportAvailabilityRequest": {"model": "str", "skuName": "str"}, + }, ) - result = [r for r in response] + # please add some check logic here by yourself # ... @@ -41,7 +44,7 @@ def test_service_validate_address(self, resource_group): "shippingAddress": { "country": "str", "streetAddress1": "str", - "addressType": "None", + "addressType": "str", "city": "str", "companyName": "str", "postalCode": "str", @@ -56,7 +59,6 @@ def test_service_validate_address(self, resource_group): "model": "str", "transportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, }, - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -64,15 +66,13 @@ def test_service_validate_address(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_service_validate_inputs_by_resource_group(self, resource_group): - response = self.client.service.validate_inputs_by_resource_group( - resource_group_name=resource_group.name, + def test_service_validate_inputs(self, resource_group): + response = self.client.service.validate_inputs( location="str", validation_request={ "individualRequestDetails": ["validation_input_request"], "validationCategory": "JobCreationValidation", }, - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -80,23 +80,21 @@ def test_service_validate_inputs_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_service_validate_inputs(self, resource_group): - response = self.client.service.validate_inputs( + def test_service_list_available_skus_by_resource_group(self, resource_group): + response = self.client.service.list_available_skus_by_resource_group( + resource_group_name=resource_group.name, location="str", - validation_request={ - "individualRequestDetails": ["validation_input_request"], - "validationCategory": "JobCreationValidation", - }, - api_version="2025-02-01", + available_sku_request={"country": "str", "location": "str", "transferType": "str", "skuNames": ["str"]}, ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_service_region_configuration(self, resource_group): - response = self.client.service.region_configuration( + def test_service_region_configuration_by_resource_group(self, resource_group): + response = self.client.service.region_configuration_by_resource_group( + resource_group_name=resource_group.name, location="str", region_configuration_request={ "datacenterAddressRequest": {"skuName": "str", "storageLocation": "str", "model": "str"}, @@ -104,7 +102,6 @@ def test_service_region_configuration(self, resource_group): "scheduleAvailabilityRequest": "schedule_availability_request", "transportAvailabilityRequest": {"model": "str", "skuName": "str"}, }, - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -112,17 +109,14 @@ def test_service_region_configuration(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_service_region_configuration_by_resource_group(self, resource_group): - response = self.client.service.region_configuration_by_resource_group( + def test_service_validate_inputs_by_resource_group(self, resource_group): + response = self.client.service.validate_inputs_by_resource_group( resource_group_name=resource_group.name, location="str", - region_configuration_request={ - "datacenterAddressRequest": {"skuName": "str", "storageLocation": "str", "model": "str"}, - "deviceCapabilityRequest": {"model": "str", "skuName": "str"}, - "scheduleAvailabilityRequest": "schedule_availability_request", - "transportAvailabilityRequest": {"model": "str", "skuName": "str"}, + validation_request={ + "individualRequestDetails": ["validation_input_request"], + "validationCategory": "JobCreationValidation", }, - api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations_async.py b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations_async.py index 2cc884be54f9..cd3d993ff700 100644 --- a/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations_async.py +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,14 +21,17 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_service_list_available_skus_by_resource_group(self, resource_group): - response = self.client.service.list_available_skus_by_resource_group( - resource_group_name=resource_group.name, + async def test_service_region_configuration(self, resource_group): + response = await self.client.service.region_configuration( location="str", - available_sku_request={"country": "str", "location": "str", "transferType": "str", "skuNames": ["str"]}, - api_version="2025-02-01", + region_configuration_request={ + "datacenterAddressRequest": {"skuName": "str", "storageLocation": "str", "model": "str"}, + "deviceCapabilityRequest": {"model": "str", "skuName": "str"}, + "scheduleAvailabilityRequest": "schedule_availability_request", + "transportAvailabilityRequest": {"model": "str", "skuName": "str"}, + }, ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @@ -42,7 +45,7 @@ async def test_service_validate_address(self, resource_group): "shippingAddress": { "country": "str", "streetAddress1": "str", - "addressType": "None", + "addressType": "str", "city": "str", "companyName": "str", "postalCode": "str", @@ -57,7 +60,6 @@ async def test_service_validate_address(self, resource_group): "model": "str", "transportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, }, - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -65,15 +67,13 @@ async def test_service_validate_address(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_service_validate_inputs_by_resource_group(self, resource_group): - response = await self.client.service.validate_inputs_by_resource_group( - resource_group_name=resource_group.name, + async def test_service_validate_inputs(self, resource_group): + response = await self.client.service.validate_inputs( location="str", validation_request={ "individualRequestDetails": ["validation_input_request"], "validationCategory": "JobCreationValidation", }, - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -81,23 +81,21 @@ async def test_service_validate_inputs_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_service_validate_inputs(self, resource_group): - response = await self.client.service.validate_inputs( + async def test_service_list_available_skus_by_resource_group(self, resource_group): + response = self.client.service.list_available_skus_by_resource_group( + resource_group_name=resource_group.name, location="str", - validation_request={ - "individualRequestDetails": ["validation_input_request"], - "validationCategory": "JobCreationValidation", - }, - api_version="2025-02-01", + available_sku_request={"country": "str", "location": "str", "transferType": "str", "skuNames": ["str"]}, ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_service_region_configuration(self, resource_group): - response = await self.client.service.region_configuration( + async def test_service_region_configuration_by_resource_group(self, resource_group): + response = await self.client.service.region_configuration_by_resource_group( + resource_group_name=resource_group.name, location="str", region_configuration_request={ "datacenterAddressRequest": {"skuName": "str", "storageLocation": "str", "model": "str"}, @@ -105,7 +103,6 @@ async def test_service_region_configuration(self, resource_group): "scheduleAvailabilityRequest": "schedule_availability_request", "transportAvailabilityRequest": {"model": "str", "skuName": "str"}, }, - api_version="2025-02-01", ) # please add some check logic here by yourself @@ -113,17 +110,14 @@ async def test_service_region_configuration(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_service_region_configuration_by_resource_group(self, resource_group): - response = await self.client.service.region_configuration_by_resource_group( + async def test_service_validate_inputs_by_resource_group(self, resource_group): + response = await self.client.service.validate_inputs_by_resource_group( resource_group_name=resource_group.name, location="str", - region_configuration_request={ - "datacenterAddressRequest": {"skuName": "str", "storageLocation": "str", "model": "str"}, - "deviceCapabilityRequest": {"model": "str", "skuName": "str"}, - "scheduleAvailabilityRequest": "schedule_availability_request", - "transportAvailabilityRequest": {"model": "str", "skuName": "str"}, + validation_request={ + "individualRequestDetails": ["validation_input_request"], + "validationCategory": "JobCreationValidation", }, - api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/databox/azure-mgmt-databox/pyproject.toml b/sdk/databox/azure-mgmt-databox/pyproject.toml index 540da07d41af..396b53c18a52 100644 --- a/sdk/databox/azure-mgmt-databox/pyproject.toml +++ b/sdk/databox/azure-mgmt-databox/pyproject.toml @@ -1,6 +1,88 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-databox" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Databox Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +requires-python = ">=3.10" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.databox._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false mypy = false pyright = false type_check_samples = false verifytypes = false + +[packaging] +package_name = "azure-mgmt-databox" +package_pprint_name = "Data Box Management" +package_doc_id = "" +is_stable = false +title = "DataBoxManagementClient" +package_nspkg = "azure-mgmt-nspkg" +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" diff --git a/sdk/databox/azure-mgmt-databox/sdk_packaging.toml b/sdk/databox/azure-mgmt-databox/sdk_packaging.toml deleted file mode 100644 index ed21d2213961..000000000000 --- a/sdk/databox/azure-mgmt-databox/sdk_packaging.toml +++ /dev/null @@ -1,6 +0,0 @@ -[packaging] -package_name = "azure-mgmt-databox" -package_pprint_name = "Data Box Management" -package_doc_id = "" -is_stable = true -title = "DataBoxManagementClient" diff --git a/sdk/databox/azure-mgmt-databox/setup.py b/sdk/databox/azure-mgmt-databox/setup.py deleted file mode 100644 index a501a52acfdd..000000000000 --- a/sdk/databox/azure-mgmt-databox/setup.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-databox" -PACKAGE_PPRINT_NAME = "Data Box Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py"), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", - ], - python_requires=">=3.8", -) diff --git a/sdk/databox/azure-mgmt-databox/tsp-location.yaml b/sdk/databox/azure-mgmt-databox/tsp-location.yaml new file mode 100644 index 000000000000..a3cc57c8833b --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/databox/resource-manager/Microsoft.DataBox/DataBox +commit: 6c19e3347d60ee62bccec0b56680ca79a162b99b +repo: Azure/azure-rest-api-specs +additionalDirectories: From b8c61a0dd92f592a8495fbdd7838621e27b60742 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 6 Jul 2026 13:19:32 +0800 Subject: [PATCH 2/4] Optimize changelog for azure-mgmt-databox --- sdk/databox/azure-mgmt-databox/CHANGELOG.md | 68 +++++---------------- 1 file changed, 16 insertions(+), 52 deletions(-) diff --git a/sdk/databox/azure-mgmt-databox/CHANGELOG.md b/sdk/databox/azure-mgmt-databox/CHANGELOG.md index ff80ecb10fac..bd0aa4cf4f4d 100644 --- a/sdk/databox/azure-mgmt-databox/CHANGELOG.md +++ b/sdk/databox/azure-mgmt-databox/CHANGELOG.md @@ -7,67 +7,31 @@ - Client `DataBoxManagementClient` added parameter `cloud_setting` in method `__init__` - Client `DataBoxManagementClient` added method `send_request` - Model `DeviceErasureDetails` added property `secure_erasure_certificate_sas_key` - - Model `JobResource` added property `properties` - - Model `JobResourceUpdateParameter` added property `properties` - - Model `SkuInformation` added property `properties` - Added enum `CreatedByType` - - Added model `JobProperties` - Added model `OperationProperties` - - Added model `SkuProperties` - Added model `TrackedResource` - - Added model `UpdateJobProperties` - - Added model `ValidationResponseProperties` - - Model `JobsOperations` added parameter `etag` in method `begin_update` - - Model `JobsOperations` added parameter `match_condition` in method `begin_update` ### Breaking Changes - - Model `AddressValidationOutput` deleted or renamed its instance variable `validation_type` - - Model `AddressValidationOutput` deleted or renamed its instance variable `error` - - Model `AddressValidationOutput` deleted or renamed its instance variable `validation_status` - - Model `AddressValidationOutput` deleted or renamed its instance variable `alternate_addresses` - - Model `JobResource` deleted or renamed its instance variable `transfer_type` - - Model `JobResource` deleted or renamed its instance variable `is_cancellable` - - Model `JobResource` deleted or renamed its instance variable `is_deletable` - - Model `JobResource` deleted or renamed its instance variable `is_shipping_address_editable` - - Model `JobResource` deleted or renamed its instance variable `reverse_shipping_details_update` - - Model `JobResource` deleted or renamed its instance variable `reverse_transport_preference_update` - - Model `JobResource` deleted or renamed its instance variable `is_prepare_to_ship_enabled` - - Model `JobResource` deleted or renamed its instance variable `status` - - Model `JobResource` deleted or renamed its instance variable `delayed_stage` - - Model `JobResource` deleted or renamed its instance variable `start_time` - - Model `JobResource` deleted or renamed its instance variable `error` - - Model `JobResource` deleted or renamed its instance variable `details` - - Model `JobResource` deleted or renamed its instance variable `cancellation_reason` - - Model `JobResource` deleted or renamed its instance variable `delivery_type` - - Model `JobResource` deleted or renamed its instance variable `delivery_info` - - Model `JobResource` deleted or renamed its instance variable `is_cancellable_without_fee` - - Model `JobResource` deleted or renamed its instance variable `all_devices_lost` - - Model `JobResourceUpdateParameter` deleted or renamed its instance variable `details` - - Model `Resource` deleted or renamed its instance variable `location` - - Model `Resource` deleted or renamed its instance variable `tags` - - Model `Resource` deleted or renamed its instance variable `sku` - - Model `Resource` deleted or renamed its instance variable `identity` - - Model `SkuInformation` deleted or renamed its instance variable `data_location_to_service_location_map` - - Model `SkuInformation` deleted or renamed its instance variable `capacity` - - Model `SkuInformation` deleted or renamed its instance variable `costs` - - Model `SkuInformation` deleted or renamed its instance variable `api_versions` - - Model `SkuInformation` deleted or renamed its instance variable `disabled_reason` - - Model `SkuInformation` deleted or renamed its instance variable `disabled_reason_message` - - Model `SkuInformation` deleted or renamed its instance variable `required_feature` - - Model `SkuInformation` deleted or renamed its instance variable `countries_within_commerce_boundary` - - Model `ValidationResponse` deleted or renamed its instance variable `status` - - Model `ValidationResponse` deleted or renamed its instance variable `individual_response_details` - - Deleted or renamed model `ArmBaseObject` - - Deleted or renamed model `AvailableSkusResult` - - Deleted or renamed model `JobResourceList` - - Deleted or renamed model `OperationList` - - Deleted or renamed model `UnencryptedCredentialsList` - - Method `JobsOperations.begin_update` deleted or renamed its parameter `if_match` of kind `positional_or_keyword` + - This version introduces new hybrid models which have dual dictionary and model nature. Please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration. + - For the method breakings, please refer to https://aka.ms/azsdk/python/migrate/operations for migration. + - Model `AddressValidationOutput` moved instance variable `validation_type`, `error`, `validation_status` and `alternate_addresses` under property `properties` whose type is `AddressValidationProperties` + - Model `JobResource` moved instance variable `transfer_type`, `is_cancellable`, `is_deletable`, `is_shipping_address_editable`, `reverse_shipping_details_update`, `reverse_transport_preference_update`, `is_prepare_to_ship_enabled`, `status`, `delayed_stage`, `start_time`, `error`, `details`, `cancellation_reason`, `delivery_type`, `delivery_info`, `is_cancellable_without_fee` and `all_devices_lost` under property `properties` whose type is `JobProperties` + - Model `JobResourceUpdateParameter` moved instance variable `details` under property `properties` whose type is `UpdateJobProperties` + - Model `Resource` moved instance variable `location` and `tags` under model `TrackedResource` + - Model `JobResource` moved instance variable `sku` and `identity` from base model `Resource` to `JobResource` + - Model `SkuInformation` moved instance variable `data_location_to_service_location_map`, `capacity`, `costs`, `api_versions`, `disabled_reason`, `disabled_reason_message`, `required_feature` and `countries_within_commerce_boundary` under property `properties` whose type is `SkuProperties` + - Model `ValidationResponse` moved instance variable `status` and `individual_response_details` under property `properties` whose type is `ValidationResponseProperties` + - Method `JobsOperations.begin_update` replaced positional_or_keyword parameter `if_match` to keyword_only parameters `etag`/`match_condition` - Method `JobsOperations.get` changed its parameter `expand` from `positional_or_keyword` to `keyword_only` - Method `JobsOperations.list` changed its parameter `skip_token` from `positional_or_keyword` to `keyword_only` - Method `JobsOperations.list_by_resource_group` changed its parameter `skip_token` from `positional_or_keyword` to `keyword_only` - - Deleted or renamed model `DataBoxManagementClientOperationsMixin` + - Operation group `DataBoxManagementClientOperationsMixin` renamed to `_DataBoxManagementClientOperationsMixin` + +### Other Changes + + - Deleted model `AvailableSkusResult`/`JobResourceList`/`OperationList`/`UnencryptedCredentialsList` which actually were not used by SDK users + - Deleted model `ArmBaseObject` which actually was not used by SDK users ## 3.1.0 (2025-03-18) From b2f1d8a9abe1a692c899a604c74f26fa1bcfba1e Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 6 Jul 2026 13:22:10 +0800 Subject: [PATCH 3/4] Add live tests for azure-mgmt-databox --- sdk/databox/azure-mgmt-databox/dev_requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/databox/azure-mgmt-databox/dev_requirements.txt b/sdk/databox/azure-mgmt-databox/dev_requirements.txt index 0a8d1282d521..8d05a3a42632 100644 --- a/sdk/databox/azure-mgmt-databox/dev_requirements.txt +++ b/sdk/databox/azure-mgmt-databox/dev_requirements.txt @@ -1,3 +1,5 @@ -e ../../../eng/tools/azure-sdk-tools ../../resources/azure-mgmt-resource aiohttp + +azure-identity \ No newline at end of file From 734230158961be96b29285f77cef443e0aef6527 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 6 Jul 2026 13:48:26 +0800 Subject: [PATCH 4/4] Update CHANGELOG.md --- sdk/databox/azure-mgmt-databox/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/databox/azure-mgmt-databox/CHANGELOG.md b/sdk/databox/azure-mgmt-databox/CHANGELOG.md index bd0aa4cf4f4d..e194810baadc 100644 --- a/sdk/databox/azure-mgmt-databox/CHANGELOG.md +++ b/sdk/databox/azure-mgmt-databox/CHANGELOG.md @@ -26,12 +26,12 @@ - Method `JobsOperations.get` changed its parameter `expand` from `positional_or_keyword` to `keyword_only` - Method `JobsOperations.list` changed its parameter `skip_token` from `positional_or_keyword` to `keyword_only` - Method `JobsOperations.list_by_resource_group` changed its parameter `skip_token` from `positional_or_keyword` to `keyword_only` - - Operation group `DataBoxManagementClientOperationsMixin` renamed to `_DataBoxManagementClientOperationsMixin` ### Other Changes - Deleted model `AvailableSkusResult`/`JobResourceList`/`OperationList`/`UnencryptedCredentialsList` which actually were not used by SDK users - Deleted model `ArmBaseObject` which actually was not used by SDK users + - Operation group `DataBoxManagementClientOperationsMixin` renamed to `_DataBoxManagementClientOperationsMixin` ## 3.1.0 (2025-03-18)