From 302fe43b6a2f0ef9e2809d3a5ed5d42b8fa948d0 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 30 Oct 2024 02:49:10 +0000 Subject: [PATCH 1/2] code and test --- sdk/databox/azure-mgmt-databox/CHANGELOG.md | 18 + sdk/databox/azure-mgmt-databox/README.md | 7 +- sdk/databox/azure-mgmt-databox/_meta.json | 10 +- .../azure/mgmt/databox/__init__.py | 18 +- .../azure/mgmt/databox/_configuration.py | 58 +- .../databox/_data_box_management_client.py | 328 +- .../azure/mgmt/databox/_operations_mixin.py | 71 - .../mgmt/databox/{v2018_01_01 => }/_patch.py | 0 .../azure/mgmt/databox/_serialization.py | 122 +- .../databox/{v2021_03_01/aio => }/_vendor.py | 8 +- .../azure/mgmt/databox/_version.py | 7 +- .../azure/mgmt/databox/aio/__init__.py | 15 +- .../azure/mgmt/databox/aio/_configuration.py | 58 +- .../aio/_data_box_management_client.py | 328 +- .../mgmt/databox/aio/_operations_mixin.py | 71 - .../databox/{v2018_01_01 => }/aio/_patch.py | 0 .../{v2021_08_01_preview => }/aio/_vendor.py | 4 +- .../aio/operations/__init__.py | 0 .../_data_box_management_client_operations.py | 55 +- .../aio/operations/_jobs_operations.py | 535 +- .../aio/operations/_operations.py | 44 +- .../aio/operations/_patch.py | 0 .../aio/operations/_service_operations.py | 331 +- .../azure/mgmt/databox/models.py | 7 - .../{v2022_12_01 => }/models/__init__.py | 0 .../_data_box_management_client_enums.py | 6 +- .../{v2022_12_01 => }/models/_models_py3.py | 1064 ++- .../{v2018_01_01 => }/models/_patch.py | 0 .../{v2021_03_01 => }/operations/__init__.py | 0 .../_data_box_management_client_operations.py | 60 +- .../operations/_jobs_operations.py | 555 +- .../operations/_operations.py | 47 +- .../{v2018_01_01 => }/operations/_patch.py | 0 .../operations/_service_operations.py | 342 +- .../mgmt/databox/v2018_01_01/__init__.py | 26 - .../databox/v2018_01_01/_configuration.py | 66 - .../_data_box_management_client.py | 97 - .../mgmt/databox/v2018_01_01/_metadata.json | 112 - .../azure/mgmt/databox/v2018_01_01/_vendor.py | 30 - .../mgmt/databox/v2018_01_01/_version.py | 9 - .../mgmt/databox/v2018_01_01/aio/__init__.py | 23 - .../databox/v2018_01_01/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 97 - .../v2018_01_01/aio/operations/__init__.py | 23 - .../aio/operations/_jobs_operations.py | 1269 ---- .../v2018_01_01/aio/operations/_operations.py | 133 - .../aio/operations/_service_operations.py | 325 - .../databox/v2018_01_01/models/__init__.py | 149 - .../_data_box_management_client_enums.py | 193 - .../databox/v2018_01_01/models/_models_py3.py | 2534 ------- .../v2018_01_01/operations/__init__.py | 23 - .../operations/_jobs_operations.py | 1535 ---- .../v2018_01_01/operations/_operations.py | 154 - .../operations/_service_operations.py | 385 - .../azure/mgmt/databox/v2018_01_01/py.typed | 1 - .../mgmt/databox/v2019_09_01/__init__.py | 26 - .../databox/v2019_09_01/_configuration.py | 66 - .../_data_box_management_client.py | 97 - .../mgmt/databox/v2019_09_01/_metadata.json | 112 - .../azure/mgmt/databox/v2019_09_01/_patch.py | 20 - .../azure/mgmt/databox/v2019_09_01/_vendor.py | 30 - .../mgmt/databox/v2019_09_01/_version.py | 9 - .../mgmt/databox/v2019_09_01/aio/__init__.py | 23 - .../databox/v2019_09_01/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 97 - .../mgmt/databox/v2019_09_01/aio/_patch.py | 20 - .../v2019_09_01/aio/operations/__init__.py | 23 - .../aio/operations/_jobs_operations.py | 1269 ---- .../v2019_09_01/aio/operations/_operations.py | 133 - .../v2019_09_01/aio/operations/_patch.py | 20 - .../aio/operations/_service_operations.py | 891 --- .../databox/v2019_09_01/models/__init__.py | 219 - .../_data_box_management_client_enums.py | 264 - .../databox/v2019_09_01/models/_models_py3.py | 3855 ---------- .../mgmt/databox/v2019_09_01/models/_patch.py | 20 - .../v2019_09_01/operations/__init__.py | 23 - .../operations/_jobs_operations.py | 1544 ---- .../v2019_09_01/operations/_operations.py | 154 - .../databox/v2019_09_01/operations/_patch.py | 20 - .../operations/_service_operations.py | 1071 --- .../azure/mgmt/databox/v2019_09_01/py.typed | 1 - .../mgmt/databox/v2020_04_01/__init__.py | 26 - .../databox/v2020_04_01/_configuration.py | 66 - .../_data_box_management_client.py | 97 - .../mgmt/databox/v2020_04_01/_metadata.json | 112 - .../azure/mgmt/databox/v2020_04_01/_patch.py | 20 - .../azure/mgmt/databox/v2020_04_01/_vendor.py | 30 - .../mgmt/databox/v2020_04_01/_version.py | 9 - .../mgmt/databox/v2020_04_01/aio/__init__.py | 23 - .../databox/v2020_04_01/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 97 - .../mgmt/databox/v2020_04_01/aio/_patch.py | 20 - .../v2020_04_01/aio/operations/__init__.py | 23 - .../aio/operations/_jobs_operations.py | 1278 ---- .../v2020_04_01/aio/operations/_patch.py | 20 - .../databox/v2020_04_01/models/__init__.py | 257 - .../_data_box_management_client_enums.py | 313 - .../databox/v2020_04_01/models/_models_py3.py | 4564 ------------ .../mgmt/databox/v2020_04_01/models/_patch.py | 20 - .../v2020_04_01/operations/__init__.py | 23 - .../operations/_jobs_operations.py | 1553 ---- .../v2020_04_01/operations/_operations.py | 155 - .../databox/v2020_04_01/operations/_patch.py | 20 - .../operations/_service_operations.py | 1083 --- .../azure/mgmt/databox/v2020_04_01/py.typed | 1 - .../mgmt/databox/v2020_11_01/__init__.py | 26 - .../databox/v2020_11_01/_configuration.py | 66 - .../_data_box_management_client.py | 97 - .../mgmt/databox/v2020_11_01/_metadata.json | 112 - .../azure/mgmt/databox/v2020_11_01/_patch.py | 20 - .../azure/mgmt/databox/v2020_11_01/_vendor.py | 30 - .../mgmt/databox/v2020_11_01/_version.py | 9 - .../mgmt/databox/v2020_11_01/aio/__init__.py | 23 - .../databox/v2020_11_01/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 97 - .../mgmt/databox/v2020_11_01/aio/_patch.py | 20 - .../v2020_11_01/aio/operations/__init__.py | 23 - .../aio/operations/_jobs_operations.py | 1278 ---- .../v2020_11_01/aio/operations/_operations.py | 134 - .../v2020_11_01/aio/operations/_patch.py | 20 - .../aio/operations/_service_operations.py | 896 --- .../databox/v2020_11_01/models/__init__.py | 269 - .../_data_box_management_client_enums.py | 322 - .../databox/v2020_11_01/models/_models_py3.py | 4761 ------------ .../mgmt/databox/v2020_11_01/models/_patch.py | 20 - .../v2020_11_01/operations/__init__.py | 23 - .../operations/_jobs_operations.py | 1553 ---- .../databox/v2020_11_01/operations/_patch.py | 20 - .../operations/_service_operations.py | 1083 --- .../azure/mgmt/databox/v2020_11_01/py.typed | 1 - .../mgmt/databox/v2021_03_01/__init__.py | 26 - .../databox/v2021_03_01/_configuration.py | 66 - .../_data_box_management_client.py | 99 - .../mgmt/databox/v2021_03_01/_metadata.json | 133 - .../azure/mgmt/databox/v2021_03_01/_patch.py | 20 - .../azure/mgmt/databox/v2021_03_01/_vendor.py | 48 - .../mgmt/databox/v2021_03_01/_version.py | 9 - .../mgmt/databox/v2021_03_01/aio/__init__.py | 23 - .../databox/v2021_03_01/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 99 - .../mgmt/databox/v2021_03_01/aio/_patch.py | 20 - .../aio/operations/_jobs_operations.py | 1279 ---- .../v2021_03_01/aio/operations/_operations.py | 135 - .../v2021_03_01/aio/operations/_patch.py | 20 - .../aio/operations/_service_operations.py | 897 --- .../databox/v2021_03_01/models/__init__.py | 275 - .../_data_box_management_client_enums.py | 333 - .../databox/v2021_03_01/models/_models_py3.py | 4876 ------------- .../mgmt/databox/v2021_03_01/models/_patch.py | 20 - .../_data_box_management_client_operations.py | 210 - .../operations/_jobs_operations.py | 1553 ---- .../v2021_03_01/operations/_operations.py | 155 - .../databox/v2021_03_01/operations/_patch.py | 20 - .../operations/_service_operations.py | 1083 --- .../azure/mgmt/databox/v2021_03_01/py.typed | 1 - .../mgmt/databox/v2021_05_01/__init__.py | 26 - .../databox/v2021_05_01/_configuration.py | 66 - .../_data_box_management_client.py | 99 - .../mgmt/databox/v2021_05_01/_metadata.json | 133 - .../azure/mgmt/databox/v2021_05_01/_patch.py | 20 - .../azure/mgmt/databox/v2021_05_01/_vendor.py | 48 - .../mgmt/databox/v2021_05_01/_version.py | 9 - .../mgmt/databox/v2021_05_01/aio/__init__.py | 23 - .../databox/v2021_05_01/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 99 - .../mgmt/databox/v2021_05_01/aio/_patch.py | 20 - .../mgmt/databox/v2021_05_01/aio/_vendor.py | 28 - .../v2021_05_01/aio/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 176 - .../aio/operations/_jobs_operations.py | 1279 ---- .../v2021_05_01/aio/operations/_operations.py | 135 - .../v2021_05_01/aio/operations/_patch.py | 20 - .../aio/operations/_service_operations.py | 897 --- .../databox/v2021_05_01/models/__init__.py | 275 - .../_data_box_management_client_enums.py | 339 - .../databox/v2021_05_01/models/_models_py3.py | 4877 ------------- .../mgmt/databox/v2021_05_01/models/_patch.py | 20 - .../v2021_05_01/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 210 - .../operations/_jobs_operations.py | 1553 ---- .../v2021_05_01/operations/_operations.py | 155 - .../databox/v2021_05_01/operations/_patch.py | 20 - .../operations/_service_operations.py | 1083 --- .../azure/mgmt/databox/v2021_05_01/py.typed | 1 - .../databox/v2021_08_01_preview/__init__.py | 26 - .../v2021_08_01_preview/_configuration.py | 66 - .../_data_box_management_client.py | 99 - .../v2021_08_01_preview/_metadata.json | 133 - .../databox/v2021_08_01_preview/_patch.py | 20 - .../databox/v2021_08_01_preview/_vendor.py | 48 - .../databox/v2021_08_01_preview/_version.py | 9 - .../v2021_08_01_preview/aio/__init__.py | 23 - .../v2021_08_01_preview/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 99 - .../databox/v2021_08_01_preview/aio/_patch.py | 20 - .../aio/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 177 - .../aio/operations/_jobs_operations.py | 1432 ---- .../aio/operations/_operations.py | 135 - .../aio/operations/_patch.py | 20 - .../aio/operations/_service_operations.py | 900 --- .../v2021_08_01_preview/models/__init__.py | 305 - .../_data_box_management_client_enums.py | 438 -- .../v2021_08_01_preview/models/_models_py3.py | 5847 --------------- .../v2021_08_01_preview/models/_patch.py | 20 - .../operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 211 - .../operations/_jobs_operations.py | 1741 ----- .../operations/_operations.py | 155 - .../v2021_08_01_preview/operations/_patch.py | 20 - .../operations/_service_operations.py | 1089 --- .../mgmt/databox/v2021_08_01_preview/py.typed | 1 - .../mgmt/databox/v2021_12_01/__init__.py | 26 - .../databox/v2021_12_01/_configuration.py | 66 - .../_data_box_management_client.py | 99 - .../mgmt/databox/v2021_12_01/_metadata.json | 133 - .../azure/mgmt/databox/v2021_12_01/_patch.py | 20 - .../azure/mgmt/databox/v2021_12_01/_vendor.py | 48 - .../mgmt/databox/v2021_12_01/_version.py | 9 - .../mgmt/databox/v2021_12_01/aio/__init__.py | 23 - .../databox/v2021_12_01/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 99 - .../mgmt/databox/v2021_12_01/aio/_patch.py | 20 - .../mgmt/databox/v2021_12_01/aio/_vendor.py | 28 - .../v2021_12_01/aio/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 176 - .../aio/operations/_jobs_operations.py | 1424 ---- .../v2021_12_01/aio/operations/_operations.py | 135 - .../v2021_12_01/aio/operations/_patch.py | 20 - .../aio/operations/_service_operations.py | 897 --- .../databox/v2021_12_01/models/__init__.py | 313 - .../_data_box_management_client_enums.py | 450 -- .../databox/v2021_12_01/models/_models_py3.py | 6057 ---------------- .../mgmt/databox/v2021_12_01/models/_patch.py | 20 - .../v2021_12_01/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 210 - .../operations/_jobs_operations.py | 1731 ----- .../v2021_12_01/operations/_operations.py | 155 - .../databox/v2021_12_01/operations/_patch.py | 20 - .../operations/_service_operations.py | 1083 --- .../azure/mgmt/databox/v2021_12_01/py.typed | 1 - .../mgmt/databox/v2022_02_01/__init__.py | 26 - .../databox/v2022_02_01/_configuration.py | 66 - .../_data_box_management_client.py | 99 - .../mgmt/databox/v2022_02_01/_metadata.json | 133 - .../azure/mgmt/databox/v2022_02_01/_patch.py | 20 - .../azure/mgmt/databox/v2022_02_01/_vendor.py | 48 - .../mgmt/databox/v2022_02_01/_version.py | 9 - .../mgmt/databox/v2022_02_01/aio/__init__.py | 23 - .../databox/v2022_02_01/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 99 - .../mgmt/databox/v2022_02_01/aio/_patch.py | 20 - .../mgmt/databox/v2022_02_01/aio/_vendor.py | 28 - .../v2022_02_01/aio/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 176 - .../aio/operations/_jobs_operations.py | 1424 ---- .../v2022_02_01/aio/operations/_operations.py | 135 - .../v2022_02_01/aio/operations/_patch.py | 20 - .../aio/operations/_service_operations.py | 897 --- .../databox/v2022_02_01/models/__init__.py | 315 - .../_data_box_management_client_enums.py | 450 -- .../databox/v2022_02_01/models/_models_py3.py | 6117 ---------------- .../mgmt/databox/v2022_02_01/models/_patch.py | 20 - .../v2022_02_01/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 210 - .../operations/_jobs_operations.py | 1731 ----- .../v2022_02_01/operations/_operations.py | 155 - .../databox/v2022_02_01/operations/_patch.py | 20 - .../operations/_service_operations.py | 1083 --- .../azure/mgmt/databox/v2022_02_01/py.typed | 1 - .../mgmt/databox/v2022_09_01/__init__.py | 26 - .../databox/v2022_09_01/_configuration.py | 66 - .../_data_box_management_client.py | 99 - .../mgmt/databox/v2022_09_01/_metadata.json | 133 - .../azure/mgmt/databox/v2022_09_01/_patch.py | 20 - .../azure/mgmt/databox/v2022_09_01/_vendor.py | 48 - .../mgmt/databox/v2022_09_01/_version.py | 9 - .../mgmt/databox/v2022_09_01/aio/__init__.py | 23 - .../databox/v2022_09_01/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 99 - .../mgmt/databox/v2022_09_01/aio/_patch.py | 20 - .../mgmt/databox/v2022_09_01/aio/_vendor.py | 28 - .../v2022_09_01/aio/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 176 - .../aio/operations/_jobs_operations.py | 1432 ---- .../v2022_09_01/aio/operations/_operations.py | 135 - .../v2022_09_01/aio/operations/_patch.py | 20 - .../aio/operations/_service_operations.py | 897 --- .../databox/v2022_09_01/models/__init__.py | 323 - .../_data_box_management_client_enums.py | 474 -- .../databox/v2022_09_01/models/_models_py3.py | 6314 ---------------- .../mgmt/databox/v2022_09_01/models/_patch.py | 20 - .../v2022_09_01/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 210 - .../operations/_jobs_operations.py | 1739 ----- .../v2022_09_01/operations/_operations.py | 155 - .../databox/v2022_09_01/operations/_patch.py | 20 - .../operations/_service_operations.py | 1083 --- .../azure/mgmt/databox/v2022_09_01/py.typed | 1 - .../mgmt/databox/v2022_10_01/__init__.py | 26 - .../databox/v2022_10_01/_configuration.py | 66 - .../_data_box_management_client.py | 99 - .../mgmt/databox/v2022_10_01/_metadata.json | 133 - .../azure/mgmt/databox/v2022_10_01/_patch.py | 20 - .../azure/mgmt/databox/v2022_10_01/_vendor.py | 48 - .../mgmt/databox/v2022_10_01/_version.py | 9 - .../mgmt/databox/v2022_10_01/aio/__init__.py | 23 - .../databox/v2022_10_01/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 99 - .../mgmt/databox/v2022_10_01/aio/_patch.py | 20 - .../mgmt/databox/v2022_10_01/aio/_vendor.py | 28 - .../v2022_10_01/aio/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 176 - .../aio/operations/_jobs_operations.py | 1432 ---- .../v2022_10_01/aio/operations/_operations.py | 135 - .../v2022_10_01/aio/operations/_patch.py | 20 - .../aio/operations/_service_operations.py | 897 --- .../databox/v2022_10_01/models/__init__.py | 323 - .../_data_box_management_client_enums.py | 474 -- .../databox/v2022_10_01/models/_models_py3.py | 6350 ----------------- .../mgmt/databox/v2022_10_01/models/_patch.py | 20 - .../v2022_10_01/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 210 - .../operations/_jobs_operations.py | 1739 ----- .../v2022_10_01/operations/_operations.py | 155 - .../databox/v2022_10_01/operations/_patch.py | 20 - .../operations/_service_operations.py | 1083 --- .../azure/mgmt/databox/v2022_10_01/py.typed | 1 - .../mgmt/databox/v2022_12_01/__init__.py | 26 - .../databox/v2022_12_01/_configuration.py | 66 - .../_data_box_management_client.py | 99 - .../mgmt/databox/v2022_12_01/_metadata.json | 133 - .../azure/mgmt/databox/v2022_12_01/_patch.py | 20 - .../azure/mgmt/databox/v2022_12_01/_vendor.py | 48 - .../mgmt/databox/v2022_12_01/_version.py | 9 - .../mgmt/databox/v2022_12_01/aio/__init__.py | 23 - .../databox/v2022_12_01/aio/_configuration.py | 66 - .../aio/_data_box_management_client.py | 99 - .../mgmt/databox/v2022_12_01/aio/_patch.py | 20 - .../mgmt/databox/v2022_12_01/aio/_vendor.py | 28 - .../v2022_12_01/aio/operations/__init__.py | 25 - .../_data_box_management_client_operations.py | 176 - .../v2022_12_01/aio/operations/_operations.py | 135 - .../v2022_12_01/aio/operations/_patch.py | 20 - .../aio/operations/_service_operations.py | 897 --- .../mgmt/databox/v2022_12_01/models/_patch.py | 20 - .../v2022_12_01/operations/__init__.py | 25 - .../v2022_12_01/operations/_operations.py | 155 - .../databox/v2022_12_01/operations/_patch.py | 20 - .../azure/mgmt/databox/v2022_12_01/py.typed | 1 - .../generated_samples/available_skus_post.py | 1 + .../book_shipment_pickup_post.py | 1 + .../generated_samples/job_mitigate.py | 4 +- .../generated_samples/jobs_cancel_post.py | 4 +- .../generated_samples/jobs_create.py | 1 + .../jobs_create_device_password.py | 1 + .../jobs_create_double_encryption.py | 1 + .../generated_samples/jobs_create_export.py | 1 + ...jobs_create_with_user_assigned_identity.py | 1 + .../generated_samples/jobs_delete.py | 4 +- .../generated_samples/jobs_get.py | 1 + .../generated_samples/jobs_get_cmk.py | 1 + .../generated_samples/jobs_get_copy_stuck.py | 1 + .../generated_samples/jobs_get_export.py | 1 + .../jobs_get_waiting_for_action.py | 1 + .../generated_samples/jobs_list.py | 1 + .../jobs_list_by_resource_group.py | 1 + .../jobs_list_credentials.py | 1 + .../generated_samples/jobs_patch.py | 1 + .../generated_samples/jobs_patch_cmk.py | 1 + ..._patch_system_assigned_to_user_assigned.py | 1 + .../generated_samples/mark_devices_shipped.py | 4 +- .../generated_samples/operations_get.py | 1 + .../generated_samples/region_configuration.py | 1 + .../region_configuration_by_resource_group.py | 1 + .../validate_address_post.py | 1 + .../generated_samples/validate_inputs.py | 1 + .../validate_inputs_by_resource_group.py | 1 + .../generated_tests/conftest.py | 35 + .../test_data_box_management.py | 32 + .../test_data_box_management_async.py | 33 + ...est_data_box_management_jobs_operations.py | 260 + ...ta_box_management_jobs_operations_async.py | 267 + .../test_data_box_management_operations.py | 29 + ...st_data_box_management_operations_async.py | 30 + ..._data_box_management_service_operations.py | 126 + ...box_management_service_operations_async.py | 127 + .../azure-mgmt-databox/sdk_packaging.toml | 2 +- sdk/databox/azure-mgmt-databox/setup.py | 86 +- 389 files changed, 2631 insertions(+), 133455 deletions(-) delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_operations_mixin.py rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2018_01_01 => }/_patch.py (100%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2021_03_01/aio => }/_vendor.py (81%) delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_operations_mixin.py rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2018_01_01 => }/aio/_patch.py (100%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2021_08_01_preview => }/aio/_vendor.py (89%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2021_03_01 => }/aio/operations/__init__.py (100%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2021_03_01 => }/aio/operations/_data_box_management_client_operations.py (78%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2022_12_01 => }/aio/operations/_jobs_operations.py (72%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2020_04_01 => }/aio/operations/_operations.py (80%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2018_01_01 => }/aio/operations/_patch.py (100%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2020_04_01 => }/aio/operations/_service_operations.py (72%) delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models.py rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2022_12_01 => }/models/__init__.py (100%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2022_12_01 => }/models/_data_box_management_client_enums.py (99%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2022_12_01 => }/models/_models_py3.py (87%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2018_01_01 => }/models/_patch.py (100%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2021_03_01 => }/operations/__init__.py (100%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2022_12_01 => }/operations/_data_box_management_client_operations.py (80%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2022_12_01 => }/operations/_jobs_operations.py (76%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2020_11_01 => }/operations/_operations.py (82%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2018_01_01 => }/operations/_patch.py (100%) rename sdk/databox/azure-mgmt-databox/azure/mgmt/databox/{v2022_12_01 => }/operations/_service_operations.py (76%) delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_data_box_management_client_enums.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/py.typed delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_data_box_management_client_enums.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/py.typed delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_data_box_management_client_enums.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/py.typed delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_data_box_management_client_enums.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/py.typed delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_data_box_management_client_enums.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/py.typed delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_data_box_management_client_enums.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/py.typed delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_data_box_management_client_enums.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/py.typed delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_data_box_management_client_enums.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/py.typed delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_data_box_management_client_enums.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/py.typed delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/_data_box_management_client_enums.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/py.typed delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/_data_box_management_client_enums.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/_models_py3.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_jobs_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/py.typed delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_metadata.json delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_version.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_configuration.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_data_box_management_client.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_vendor.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_data_box_management_client_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_service_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/__init__.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_operations.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/py.typed create mode 100644 sdk/databox/azure-mgmt-databox/generated_tests/conftest.py create mode 100644 sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management.py create mode 100644 sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_async.py create mode 100644 sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations_async.py create mode 100644 sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations_async.py create mode 100644 sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations_async.py diff --git a/sdk/databox/azure-mgmt-databox/CHANGELOG.md b/sdk/databox/azure-mgmt-databox/CHANGELOG.md index db629b851d30..21eb8e46f56a 100644 --- a/sdk/databox/azure-mgmt-databox/CHANGELOG.md +++ b/sdk/databox/azure-mgmt-databox/CHANGELOG.md @@ -1,5 +1,23 @@ # Release History +## 2.1.0 (2024-10-30) + +### Features Added + + - Method `DataBoxManagementClient.mitigate` has a new overload `def mitigate(self: None, job_name: str, resource_group_name: str, mitigate_job_request: IO[bytes], content_type: str)` + - Method `DataBoxManagementClientOperationsMixin.mitigate` has a new overload `def mitigate(self: None, job_name: str, resource_group_name: str, mitigate_job_request: IO[bytes], content_type: str)` + - Method `JobsOperations.begin_create` has a new overload `def begin_create(self: None, resource_group_name: str, job_name: str, job_resource: IO[bytes], content_type: str)` + - Method `JobsOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, job_name: str, job_resource_update_parameter: IO[bytes], if_match: Optional[str], content_type: str)` + - Method `JobsOperations.book_shipment_pick_up` has a new overload `def book_shipment_pick_up(self: None, resource_group_name: str, job_name: str, shipment_pick_up_request: IO[bytes], content_type: str)` + - Method `JobsOperations.cancel` has a new overload `def cancel(self: None, resource_group_name: str, job_name: str, cancellation_reason: IO[bytes], content_type: str)` + - Method `JobsOperations.mark_devices_shipped` has a new overload `def mark_devices_shipped(self: None, job_name: str, resource_group_name: str, mark_devices_shipped_request: IO[bytes], content_type: str)` + - Method `ServiceOperations.list_available_skus_by_resource_group` has a new overload `def list_available_skus_by_resource_group(self: None, resource_group_name: str, location: str, available_sku_request: IO[bytes], content_type: str)` + - Method `ServiceOperations.region_configuration` has a new overload `def region_configuration(self: None, location: str, region_configuration_request: IO[bytes], content_type: str)` + - Method `ServiceOperations.region_configuration_by_resource_group` has a new overload `def region_configuration_by_resource_group(self: None, resource_group_name: str, location: str, region_configuration_request: IO[bytes], content_type: str)` + - Method `ServiceOperations.validate_address` has a new overload `def validate_address(self: None, location: str, validate_address: IO[bytes], content_type: str)` + - Method `ServiceOperations.validate_inputs` has a new overload `def validate_inputs(self: None, location: str, validation_request: IO[bytes], content_type: str)` + - Method `ServiceOperations.validate_inputs_by_resource_group` has a new overload `def validate_inputs_by_resource_group(self: None, resource_group_name: str, location: str, validation_request: IO[bytes], content_type: str)` + ## 2.0.0 (2023-05-22) ### Features Added diff --git a/sdk/databox/azure-mgmt-databox/README.md b/sdk/databox/azure-mgmt-databox/README.md index c1b395b2f404..85e029bff6d3 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.7+. +This package has been tested with Python 3.8+. 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.7+ is required to use this package. +- Python 3.8+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -59,6 +59,3 @@ Code samples for this package can be found at: If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-databox%2FREADME.png) diff --git a/sdk/databox/azure-mgmt-databox/_meta.json b/sdk/databox/azure-mgmt-databox/_meta.json index f61cee449bfe..a5722d23dd62 100644 --- a/sdk/databox/azure-mgmt-databox/_meta.json +++ b/sdk/databox/azure-mgmt-databox/_meta.json @@ -1,11 +1,11 @@ { - "commit": "6e70667577cfb7bc194785683ca591b95abd524c", + "commit": "2776cb32cd6ca9ea953a13ae26c954b989e83367", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", + "autorest": "3.10.2", "use": [ - "@autorest/python@6.4.8", - "@autorest/modelerfour@4.24.3" + "@autorest/python@6.19.0", + "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/databox/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "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 --tag=package-2022-12 --use=@autorest/python@6.19.0 --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/azure/mgmt/databox/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/__init__.py index 01935d3cb490..063260fb2814 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/__init__.py @@ -7,14 +7,20 @@ # -------------------------------------------------------------------------- from ._data_box_management_client import DataBoxManagementClient -__all__ = ['DataBoxManagementClient'] +from ._version import VERSION + +__version__ = VERSION try: - from ._patch import patch_sdk # type: ignore - patch_sdk() + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: - pass + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk -from ._version import VERSION +__all__ = [ + "DataBoxManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) -__version__ = VERSION +_patch_sdk() 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 1b2abc82a3f4..38a799844eb0 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py @@ -1,16 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- + from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -20,7 +17,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class DataBoxManagementClientConfiguration(Configuration): + +class DataBoxManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for DataBoxManagementClient. Note that all parameters used to create this instance are saved as instance @@ -30,38 +28,38 @@ class DataBoxManagementClientConfiguration(Configuration): :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Subscription Id. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-12-01". 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 - ): + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2022-12-01") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-mgmt-databox/{}'.format(VERSION)) + 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)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ): - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) 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/_data_box_management_client.py index b8236d53f569..d0d71f098ab2 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_data_box_management_client.py @@ -1,288 +1,120 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, TYPE_CHECKING +from typing_extensions import Self +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from . import models as _models from ._configuration import DataBoxManagementClientConfiguration -from ._operations_mixin import DataBoxManagementClientOperationsMixin from ._serialization import Deserializer, Serializer +from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class _SDKClient(object): - def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass -class DataBoxManagementClient(DataBoxManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): +class DataBoxManagementClient( + DataBoxManagementClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword """The DataBox Client. - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databox.operations.Operations + :ivar jobs: JobsOperations operations + :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. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param base_url: Service URL + :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :param profile: A profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword api_version: Api Version. Default value is "2022-12-01". 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. """ - DEFAULT_API_VERSION = '2022-12-01' - _PROFILE_TAG = "azure.mgmt.databox.DataBoxManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - }}, - _PROFILE_TAG + " latest" - ) - def __init__( self, credential: "TokenCredential", subscription_id: str, - api_version: Optional[str]=None, base_url: str = "https://management.azure.com", - profile: KnownProfiles=KnownProfiles.default, **kwargs: Any - ): - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(DataBoxManagementClient, self).__init__( - api_version=api_version, - profile=profile + ) -> None: + self._config = DataBoxManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs ) - - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} - - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: - - * 2018-01-01: :mod:`v2018_01_01.models` - * 2019-09-01: :mod:`v2019_09_01.models` - * 2020-04-01: :mod:`v2020_04_01.models` - * 2020-11-01: :mod:`v2020_11_01.models` - * 2021-03-01: :mod:`v2021_03_01.models` - * 2021-05-01: :mod:`v2021_05_01.models` - * 2021-08-01-preview: :mod:`v2021_08_01_preview.models` - * 2021-12-01: :mod:`v2021_12_01.models` - * 2022-02-01: :mod:`v2022_02_01.models` - * 2022-09-01: :mod:`v2022_09_01.models` - * 2022-10-01: :mod:`v2022_10_01.models` - * 2022-12-01: :mod:`v2022_12_01.models` - """ - if api_version == '2018-01-01': - from .v2018_01_01 import models - return models - elif api_version == '2019-09-01': - from .v2019_09_01 import models - return models - elif api_version == '2020-04-01': - from .v2020_04_01 import models - return models - elif api_version == '2020-11-01': - from .v2020_11_01 import models - return models - elif api_version == '2021-03-01': - from .v2021_03_01 import models - return models - elif api_version == '2021-05-01': - from .v2021_05_01 import models - return models - elif api_version == '2021-08-01-preview': - from .v2021_08_01_preview import models - return models - elif api_version == '2021-12-01': - from .v2021_12_01 import models - return models - elif api_version == '2022-02-01': - from .v2022_02_01 import models - return models - elif api_version == '2022-09-01': - from .v2022_09_01 import models - return models - elif api_version == '2022-10-01': - from .v2022_10_01 import models - return models - elif api_version == '2022-12-01': - from .v2022_12_01 import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def jobs(self): - """Instance depends on the API version: - - * 2018-01-01: :class:`JobsOperations` - * 2019-09-01: :class:`JobsOperations` - * 2020-04-01: :class:`JobsOperations` - * 2020-11-01: :class:`JobsOperations` - * 2021-03-01: :class:`JobsOperations` - * 2021-05-01: :class:`JobsOperations` - * 2021-08-01-preview: :class:`JobsOperations` - * 2021-12-01: :class:`JobsOperations` - * 2022-02-01: :class:`JobsOperations` - * 2022-09-01: :class:`JobsOperations` - * 2022-10-01: :class:`JobsOperations` - * 2022-12-01: :class:`JobsOperations` - """ - api_version = self._get_api_version('jobs') - if api_version == '2018-01-01': - from .v2018_01_01.operations import JobsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import JobsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import JobsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import JobsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import JobsOperations as OperationClass - elif api_version == '2021-05-01': - from .v2021_05_01.operations import JobsOperations as OperationClass - elif api_version == '2021-08-01-preview': - from .v2021_08_01_preview.operations import JobsOperations as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import JobsOperations as OperationClass - elif api_version == '2022-02-01': - from .v2022_02_01.operations import JobsOperations as OperationClass - elif api_version == '2022-09-01': - from .v2022_09_01.operations import JobsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import JobsOperations as OperationClass - elif api_version == '2022-12-01': - from .v2022_12_01.operations import JobsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def operations(self): - """Instance depends on the API version: - - * 2018-01-01: :class:`Operations` - * 2019-09-01: :class:`Operations` - * 2020-04-01: :class:`Operations` - * 2020-11-01: :class:`Operations` - * 2021-03-01: :class:`Operations` - * 2021-05-01: :class:`Operations` - * 2021-08-01-preview: :class:`Operations` - * 2021-12-01: :class:`Operations` - * 2022-02-01: :class:`Operations` - * 2022-09-01: :class:`Operations` - * 2022-10-01: :class:`Operations` - * 2022-12-01: :class:`Operations` + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + 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) + + 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.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: + """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) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse """ - api_version = self._get_api_version('operations') - if api_version == '2018-01-01': - from .v2018_01_01.operations import Operations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import Operations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import Operations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import Operations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import Operations as OperationClass - elif api_version == '2021-05-01': - from .v2021_05_01.operations import Operations as OperationClass - elif api_version == '2021-08-01-preview': - from .v2021_08_01_preview.operations import Operations as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import Operations as OperationClass - elif api_version == '2022-02-01': - from .v2022_02_01.operations import Operations as OperationClass - elif api_version == '2022-09-01': - from .v2022_09_01.operations import Operations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import Operations as OperationClass - elif api_version == '2022-12-01': - from .v2022_12_01.operations import Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - @property - def service(self): - """Instance depends on the API version: + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - * 2018-01-01: :class:`ServiceOperations` - * 2019-09-01: :class:`ServiceOperations` - * 2020-04-01: :class:`ServiceOperations` - * 2020-11-01: :class:`ServiceOperations` - * 2021-03-01: :class:`ServiceOperations` - * 2021-05-01: :class:`ServiceOperations` - * 2021-08-01-preview: :class:`ServiceOperations` - * 2021-12-01: :class:`ServiceOperations` - * 2022-02-01: :class:`ServiceOperations` - * 2022-09-01: :class:`ServiceOperations` - * 2022-10-01: :class:`ServiceOperations` - * 2022-12-01: :class:`ServiceOperations` - """ - api_version = self._get_api_version('service') - if api_version == '2018-01-01': - from .v2018_01_01.operations import ServiceOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ServiceOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ServiceOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ServiceOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ServiceOperations as OperationClass - elif api_version == '2021-05-01': - from .v2021_05_01.operations import ServiceOperations as OperationClass - elif api_version == '2021-08-01-preview': - from .v2021_08_01_preview.operations import ServiceOperations as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import ServiceOperations as OperationClass - elif api_version == '2022-02-01': - from .v2022_02_01.operations import ServiceOperations as OperationClass - elif api_version == '2022-09-01': - from .v2022_09_01.operations import ServiceOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import ServiceOperations as OperationClass - elif api_version == '2022-12-01': - from .v2022_12_01.operations import ServiceOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'service'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - def close(self): + def close(self) -> None: self._client.close() - def __enter__(self): + + def __enter__(self) -> Self: self._client.__enter__() return self - def __exit__(self, *exc_details): + + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_operations_mixin.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_operations_mixin.py deleted file mode 100644 index 44671cbe3044..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_operations_mixin.py +++ /dev/null @@ -1,71 +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 ._serialization import Serializer, Deserializer -from typing import Any, IO, Optional, Union - -from . import models as _models - - -class DataBoxManagementClientOperationsMixin(object): - - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2022_12_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('mitigate') - if api_version == '2021-03-01': - from .v2021_03_01.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2021-05-01': - from .v2021_05_01.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2021-08-01-preview': - from .v2021_08_01_preview.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2022-02-01': - from .v2022_02_01.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': - from .v2022_09_01.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2022-12-01': - from .v2022_12_01.operations import DataBoxManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'mitigate'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.mitigate(job_name, resource_group_name, mitigate_job_request, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_patch.py similarity index 100% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_patch.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_patch.py diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_serialization.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_serialization.py index e3cc6ce6ed6f..8139854b97bb 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_serialization.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_serialization.py @@ -63,8 +63,8 @@ import isodate # type: ignore -from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback -from azure.core.serialization import NULL as AzureCoreNull +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") @@ -124,7 +124,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: pass return ET.fromstring(data_as_str) # nosec - except ET.ParseError: + except ET.ParseError as err: # It might be because the server has an issue, and returned JSON with # content-type XML.... # So let's try a JSON load, and if it's still broken @@ -143,7 +143,9 @@ def _json_attemp(data): # The function hack is because Py2.7 messes up with exception # context otherwise. _LOGGER.critical("Wasn't XML not JSON, failing") - raise_with_traceback(DeserializationError, "XML is invalid") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod @@ -170,13 +172,6 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], return None -try: - basestring # type: ignore - unicode_str = unicode # type: ignore -except NameError: - basestring = str - unicode_str = str - _LOGGER = logging.getLogger(__name__) try: @@ -295,7 +290,7 @@ class Model(object): _validation: Dict[str, Dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Dict[str, Any] = {} + self.additional_properties: Optional[Dict[str, Any]] = {} for k in kwargs: 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__) @@ -340,7 +335,7 @@ def _create_xml_node(cls): return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: - """Return the JSON that would be sent to azure from this model. + """Return the JSON that would be sent to server from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -351,14 +346,12 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) + return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore 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. @@ -392,7 +385,7 @@ def my_key_transformer(key, attr_desc, value): :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) + return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore @classmethod def _infer_class_models(cls): @@ -417,7 +410,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( @@ -447,7 +440,7 @@ def from_dict( if key_extractors is None else key_extractors ) - return deserializer(cls.__name__, data, content_type=content_type) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def _flatten_subtype(cls, key, objects): @@ -547,7 +540,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): + def __init__(self, classes: Optional[Mapping[str, type]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -563,7 +556,7 @@ def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, Type[ModelType]] = 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 @@ -651,7 +644,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) - local_node.text = unicode_str(new_attr) + local_node.text = str(new_attr) serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore @@ -664,12 +657,13 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) - raise_with_traceback(SerializationError, msg, err) + raise SerializationError(msg) from err else: return serialized @@ -711,7 +705,7 @@ def body(self, data, data_type, **kwargs): ] data = deserializer._deserialize(data_type, data) except DeserializationError as err: - raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err) + raise SerializationError("Unable to build a model: " + str(err)) from err return self._serialize(data, data_type, **kwargs) @@ -731,6 +725,7 @@ def url(self, name, data, data_type, **kwargs): if kwargs.get("skip_quote") is True: output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") except SerializationError: @@ -743,7 +738,9 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. - :rtype: str + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. + :rtype: str, list :raises: TypeError if serialization fails. :raises: ValueError if data is None """ @@ -751,10 +748,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -805,7 +800,7 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: - if data is AzureCoreNull: + if data is CoreNull: return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -825,7 +820,7 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." - raise_with_traceback(SerializationError, msg.format(data, data_type), err) + raise SerializationError(msg.format(data, data_type)) from err else: return self._serialize(data, **kwargs) @@ -893,6 +888,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +902,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +954,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: @@ -985,7 +989,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) if obj_type is _long_type: return self.serialize_long(attr) - if obj_type is unicode_str: + if obj_type is str: return self.serialize_unicode(attr) if obj_type is datetime.datetime: return self.serialize_iso(attr) @@ -1162,10 +1166,10 @@ def serialize_iso(attr, **kwargs): return date + microseconds + "Z" except (ValueError, OverflowError) as err: msg = "Unable to serialize datetime object." - raise_with_traceback(SerializationError, msg, err) + raise SerializationError(msg) from err except AttributeError as err: msg = "ISO-8601 object must be valid Datetime object." - raise_with_traceback(TypeError, msg, err) + raise TypeError(msg) from err @staticmethod def serialize_unix(attr, **kwargs): @@ -1201,7 +1205,6 @@ def rest_key_extractor(attr, attr_desc, data): if working_data is None: # If at any point while following flatten JSON path see None, it means # that all properties under are None as well - # https://github.com/Azure/msrest-for-python/issues/197 return None key = ".".join(dict_keys[1:]) @@ -1222,7 +1225,6 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): if working_data is None: # If at any point while following flatten JSON path see None, it means # that all properties under are None as well - # https://github.com/Azure/msrest-for-python/issues/197 return None key = ".".join(dict_keys[1:]) @@ -1363,7 +1365,7 @@ class Deserializer(object): 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}]?") - def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): + def __init__(self, classes: Optional[Mapping[str, type]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1383,7 +1385,7 @@ def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, Type[ModelType]] = 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 @@ -1436,12 +1438,12 @@ def _deserialize(self, target_obj, data): response, class_name = self._classify_target(target_obj, data) - if isinstance(response, basestring): + if isinstance(response, str): return self.deserialize_data(data, response) elif isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) - if data is None: + if data is None or data is CoreNull: return data try: attributes = response._attribute_map # type: ignore @@ -1473,7 +1475,7 @@ def _deserialize(self, target_obj, data): d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: additional_properties = self._build_additional_properties(attributes, data) return self._instantiate_model(response, d_attrs, additional_properties) @@ -1507,14 +1509,14 @@ def _classify_target(self, target, data): if target is None: return None, None - if isinstance(target, basestring): + if isinstance(target, str): try: target = self.dependencies[target] except KeyError: return target, target try: - target = target._classify(data, self.dependencies) + target = target._classify(data, self.dependencies) # type: ignore except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1570,7 +1572,7 @@ def _unpack_content(raw_data, content_type=None): if hasattr(raw_data, "_content_consumed"): return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) - if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data @@ -1644,7 +1646,7 @@ def deserialize_data(self, data, data_type): except (ValueError, TypeError, AttributeError) as err: msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return self._deserialize(obj_type, data) @@ -1692,7 +1694,7 @@ def deserialize_object(self, attr, **kwargs): if isinstance(attr, ET.Element): # Do no recurse on XML, just return the tree as-is return attr - if isinstance(attr, basestring): + if isinstance(attr, str): return self.deserialize_basic(attr, "str") obj_type = type(attr) if obj_type in self.basic_types: @@ -1749,7 +1751,7 @@ def deserialize_basic(self, attr, data_type): if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, basestring): + elif isinstance(attr, str): if attr.lower() in ["true", "1"]: return True elif attr.lower() in ["false", "0"]: @@ -1800,7 +1802,6 @@ def deserialize_enum(data, enum_obj): data = data.value if isinstance(data, int): # Workaround. We might consider remove it in the future. - # https://github.com/Azure/azure-rest-api-specs/issues/141 try: return list(enum_obj.__members__.values())[data] except IndexError: @@ -1854,10 +1855,10 @@ def deserialize_decimal(attr): if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) # type: ignore + return decimal.Decimal(str(attr)) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err @staticmethod def deserialize_long(attr): @@ -1885,7 +1886,7 @@ def deserialize_duration(attr): duration = isodate.parse_duration(attr) except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return duration @@ -1902,7 +1903,7 @@ def deserialize_date(attr): if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - return isodate.parse_date(attr, defaultmonth=None, defaultday=None) + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) @staticmethod def deserialize_time(attr): @@ -1937,7 +1938,7 @@ def deserialize_rfc(attr): date_obj = date_obj.astimezone(tz=TZ_UTC) except ValueError as err: msg = "Cannot deserialize to rfc datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj @@ -1974,7 +1975,7 @@ def deserialize_iso(attr): raise OverflowError("Hit max or min date") except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj @@ -1990,9 +1991,10 @@ def deserialize_unix(attr): if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore try: + attr = int(attr) date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: msg = "Cannot deserialize to unix datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_vendor.py similarity index 81% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_vendor.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_vendor.py index 54f3d3ec6541..cb83e222aa65 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_vendor.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_vendor.py @@ -8,21 +8,19 @@ from abc import ABC from typing import TYPE_CHECKING -from azure.core.pipeline.transport import HttpRequest - from ._configuration import DataBoxManagementClientConfiguration if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from azure.core import AsyncPipelineClient + from azure.core import PipelineClient - from ..._serialization import Deserializer, Serializer + from ._serialization import Deserializer, Serializer class DataBoxManagementClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" - _client: "AsyncPipelineClient" + _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 88729157c488..83f24ab50946 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_version.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_version.py @@ -1,8 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "2.1.0" 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 bb6b75a72db8..955dbd6c6677 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 @@ -7,4 +7,17 @@ # -------------------------------------------------------------------------- from ._data_box_management_client import DataBoxManagementClient -__all__ = ['DataBoxManagementClient'] + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "DataBoxManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() 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 44eebd33b8d4..80fd16c751a5 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 @@ -1,16 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- + from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -20,7 +17,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class DataBoxManagementClientConfiguration(Configuration): + +class DataBoxManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for DataBoxManagementClient. Note that all parameters used to create this instance are saved as instance @@ -30,38 +28,38 @@ class DataBoxManagementClientConfiguration(Configuration): :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Subscription Id. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-12-01". 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: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2022-12-01") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-mgmt-databox/{}'.format(VERSION)) + 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)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) 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/_data_box_management_client.py index 60d1797efcd3..0b484eb1e31b 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/_data_box_management_client.py @@ -1,288 +1,122 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING +from typing_extensions import Self +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from .. import models as _models from .._serialization import Deserializer, Serializer from ._configuration import DataBoxManagementClientConfiguration -from ._operations_mixin import DataBoxManagementClientOperationsMixin +from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class _SDKClient(object): - def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass -class DataBoxManagementClient(DataBoxManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): +class DataBoxManagementClient( + DataBoxManagementClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword """The DataBox Client. - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databox.aio.operations.Operations + :ivar jobs: JobsOperations operations + :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. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param base_url: Service URL + :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :param profile: A profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword api_version: Api Version. Default value is "2022-12-01". 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. """ - DEFAULT_API_VERSION = '2022-12-01' - _PROFILE_TAG = "azure.mgmt.databox.DataBoxManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - }}, - _PROFILE_TAG + " latest" - ) - def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - api_version: Optional[str] = None, base_url: str = "https://management.azure.com", - profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(DataBoxManagementClient, self).__init__( - api_version=api_version, - profile=profile + self._config = DataBoxManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs ) - - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} - - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: - - * 2018-01-01: :mod:`v2018_01_01.models` - * 2019-09-01: :mod:`v2019_09_01.models` - * 2020-04-01: :mod:`v2020_04_01.models` - * 2020-11-01: :mod:`v2020_11_01.models` - * 2021-03-01: :mod:`v2021_03_01.models` - * 2021-05-01: :mod:`v2021_05_01.models` - * 2021-08-01-preview: :mod:`v2021_08_01_preview.models` - * 2021-12-01: :mod:`v2021_12_01.models` - * 2022-02-01: :mod:`v2022_02_01.models` - * 2022-09-01: :mod:`v2022_09_01.models` - * 2022-10-01: :mod:`v2022_10_01.models` - * 2022-12-01: :mod:`v2022_12_01.models` - """ - if api_version == '2018-01-01': - from ..v2018_01_01 import models - return models - elif api_version == '2019-09-01': - from ..v2019_09_01 import models - return models - elif api_version == '2020-04-01': - from ..v2020_04_01 import models - return models - elif api_version == '2020-11-01': - from ..v2020_11_01 import models - return models - elif api_version == '2021-03-01': - from ..v2021_03_01 import models - return models - elif api_version == '2021-05-01': - from ..v2021_05_01 import models - return models - elif api_version == '2021-08-01-preview': - from ..v2021_08_01_preview import models - return models - elif api_version == '2021-12-01': - from ..v2021_12_01 import models - return models - elif api_version == '2022-02-01': - from ..v2022_02_01 import models - return models - elif api_version == '2022-09-01': - from ..v2022_09_01 import models - return models - elif api_version == '2022-10-01': - from ..v2022_10_01 import models - return models - elif api_version == '2022-12-01': - from ..v2022_12_01 import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def jobs(self): - """Instance depends on the API version: - - * 2018-01-01: :class:`JobsOperations` - * 2019-09-01: :class:`JobsOperations` - * 2020-04-01: :class:`JobsOperations` - * 2020-11-01: :class:`JobsOperations` - * 2021-03-01: :class:`JobsOperations` - * 2021-05-01: :class:`JobsOperations` - * 2021-08-01-preview: :class:`JobsOperations` - * 2021-12-01: :class:`JobsOperations` - * 2022-02-01: :class:`JobsOperations` - * 2022-09-01: :class:`JobsOperations` - * 2022-10-01: :class:`JobsOperations` - * 2022-12-01: :class:`JobsOperations` - """ - api_version = self._get_api_version('jobs') - if api_version == '2018-01-01': - from ..v2018_01_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2019-09-01': - from ..v2019_09_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2020-04-01': - from ..v2020_04_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2020-11-01': - from ..v2020_11_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2021-05-01': - from ..v2021_05_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2021-08-01-preview': - from ..v2021_08_01_preview.aio.operations import JobsOperations as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2022-02-01': - from ..v2022_02_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2022-09-01': - from ..v2022_09_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2022-12-01': - from ..v2022_12_01.aio.operations import JobsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def operations(self): - """Instance depends on the API version: - - * 2018-01-01: :class:`Operations` - * 2019-09-01: :class:`Operations` - * 2020-04-01: :class:`Operations` - * 2020-11-01: :class:`Operations` - * 2021-03-01: :class:`Operations` - * 2021-05-01: :class:`Operations` - * 2021-08-01-preview: :class:`Operations` - * 2021-12-01: :class:`Operations` - * 2022-02-01: :class:`Operations` - * 2022-09-01: :class:`Operations` - * 2022-10-01: :class:`Operations` - * 2022-12-01: :class:`Operations` + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + 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) + + 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.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 + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse """ - api_version = self._get_api_version('operations') - if api_version == '2018-01-01': - from ..v2018_01_01.aio.operations import Operations as OperationClass - elif api_version == '2019-09-01': - from ..v2019_09_01.aio.operations import Operations as OperationClass - elif api_version == '2020-04-01': - from ..v2020_04_01.aio.operations import Operations as OperationClass - elif api_version == '2020-11-01': - from ..v2020_11_01.aio.operations import Operations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import Operations as OperationClass - elif api_version == '2021-05-01': - from ..v2021_05_01.aio.operations import Operations as OperationClass - elif api_version == '2021-08-01-preview': - from ..v2021_08_01_preview.aio.operations import Operations as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import Operations as OperationClass - elif api_version == '2022-02-01': - from ..v2022_02_01.aio.operations import Operations as OperationClass - elif api_version == '2022-09-01': - from ..v2022_09_01.aio.operations import Operations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import Operations as OperationClass - elif api_version == '2022-12-01': - from ..v2022_12_01.aio.operations import Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - @property - def service(self): - """Instance depends on the API version: + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - * 2018-01-01: :class:`ServiceOperations` - * 2019-09-01: :class:`ServiceOperations` - * 2020-04-01: :class:`ServiceOperations` - * 2020-11-01: :class:`ServiceOperations` - * 2021-03-01: :class:`ServiceOperations` - * 2021-05-01: :class:`ServiceOperations` - * 2021-08-01-preview: :class:`ServiceOperations` - * 2021-12-01: :class:`ServiceOperations` - * 2022-02-01: :class:`ServiceOperations` - * 2022-09-01: :class:`ServiceOperations` - * 2022-10-01: :class:`ServiceOperations` - * 2022-12-01: :class:`ServiceOperations` - """ - api_version = self._get_api_version('service') - if api_version == '2018-01-01': - from ..v2018_01_01.aio.operations import ServiceOperations as OperationClass - elif api_version == '2019-09-01': - from ..v2019_09_01.aio.operations import ServiceOperations as OperationClass - elif api_version == '2020-04-01': - from ..v2020_04_01.aio.operations import ServiceOperations as OperationClass - elif api_version == '2020-11-01': - from ..v2020_11_01.aio.operations import ServiceOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import ServiceOperations as OperationClass - elif api_version == '2021-05-01': - from ..v2021_05_01.aio.operations import ServiceOperations as OperationClass - elif api_version == '2021-08-01-preview': - from ..v2021_08_01_preview.aio.operations import ServiceOperations as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import ServiceOperations as OperationClass - elif api_version == '2022-02-01': - from ..v2022_02_01.aio.operations import ServiceOperations as OperationClass - elif api_version == '2022-09-01': - from ..v2022_09_01.aio.operations import ServiceOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import ServiceOperations as OperationClass - elif api_version == '2022-12-01': - from ..v2022_12_01.aio.operations import ServiceOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'service'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - async def close(self): + async def close(self) -> None: await self._client.close() - async def __aenter__(self): + + async def __aenter__(self) -> Self: await self._client.__aenter__() return self - async def __aexit__(self, *exc_details): + + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_operations_mixin.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_operations_mixin.py deleted file mode 100644 index 26d6fadd95cf..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_operations_mixin.py +++ /dev/null @@ -1,71 +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 .._serialization import Serializer, Deserializer -from typing import Any, IO, Optional, Union - -from .. import models as _models - - -class DataBoxManagementClientOperationsMixin(object): - - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2022_12_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('mitigate') - if api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2021-05-01': - from ..v2021_05_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2021-08-01-preview': - from ..v2021_08_01_preview.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2022-02-01': - from ..v2022_02_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': - from ..v2022_09_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass - elif api_version == '2022-12-01': - from ..v2022_12_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'mitigate'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.mitigate(job_name, resource_group_name, mitigate_job_request, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_patch.py similarity index 100% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_patch.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_patch.py diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_vendor.py similarity index 89% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_vendor.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_vendor.py index 54f3d3ec6541..b75cb04eacbd 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_vendor.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_vendor.py @@ -8,15 +8,13 @@ from abc import ABC from typing import TYPE_CHECKING -from azure.core.pipeline.transport import HttpRequest - from ._configuration import DataBoxManagementClientConfiguration if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core import AsyncPipelineClient - from ..._serialization import Deserializer, Serializer + from .._serialization import Deserializer, Serializer class DataBoxManagementClientMixinABC(ABC): diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/__init__.py similarity index 100% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/__init__.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/__init__.py diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/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 similarity index 78% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_data_box_management_client_operations.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_data_box_management_client_operations.py index df68c5af7282..c6a594c237d7 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -17,22 +19,25 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ..._vendor import _convert_request 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 # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC): + @overload async def mitigate( # pylint: disable=inconsistent-return-statements self, @@ -52,11 +57,10 @@ async def mitigate( # pylint: disable=inconsistent-return-statements :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.v2021_03_01.models.MitigateJobRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -67,7 +71,7 @@ async def mitigate( # pylint: disable=inconsistent-return-statements self, job_name: str, resource_group_name: str, - mitigate_job_request: IO, + mitigate_job_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -81,11 +85,10 @@ async def mitigate( # pylint: disable=inconsistent-return-statements :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 + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -96,7 +99,7 @@ async def mitigate( # pylint: disable=inconsistent-return-statements self, job_name: str, resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], + mitigate_job_request: Union[_models.MitigateJobRequest, IO[bytes]], **kwargs: Any ) -> None: """Request to mitigate for a given job. @@ -107,18 +110,14 @@ async def mitigate( # pylint: disable=inconsistent-return-statements :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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2021_03_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -129,19 +128,19 @@ async def mitigate( # pylint: disable=inconsistent-return-statements _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", "2021-03-01")) + 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, (IO, bytes)): + if isinstance(mitigate_job_request, (IOBase, bytes)): _content = mitigate_job_request else: _json = self._serialize.body(mitigate_job_request, "MitigateJobRequest") - request = build_mitigate_request( + _request = build_mitigate_request( job_name=job_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -149,16 +148,14 @@ async def mitigate( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self.mitigate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -169,8 +166,4 @@ async def mitigate( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_jobs_operations.py similarity index 72% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_jobs_operations.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_jobs_operations.py index 2c1a7efc5c42..a848bf492053 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_jobs_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_jobs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from io import IOBase +import sys +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -16,12 +18,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +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 @@ -29,7 +32,6 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request from ...operations._jobs_operations import ( build_book_shipment_pick_up_request, build_cancel_request, @@ -42,8 +44,11 @@ build_mark_devices_shipped_request, build_update_request, ) -from .._vendor import DataBoxManagementClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -54,7 +59,7 @@ class JobsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2022_12_01.aio.DataBoxManagementClient`'s + :class:`~azure.mgmt.databox.aio.DataBoxManagementClient`'s :attr:`jobs` attribute. """ @@ -74,19 +79,17 @@ def list(self, skip_token: Optional[str] = None, **kwargs: Any) -> AsyncIterable :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :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", "2022-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -97,16 +100,14 @@ def list(self, skip_token: Optional[str] = None, **kwargs: Any) -> AsyncIterable def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, skip_token=skip_token, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -118,13 +119,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _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) @@ -134,11 +134,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,8 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - @overload async def mark_devices_shipped( # pylint: disable=inconsistent-return-statements self, @@ -172,12 +170,10 @@ async def mark_devices_shipped( # pylint: disable=inconsistent-return-statement :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.v2022_12_01.models.MarkDevicesShippedRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -188,7 +184,7 @@ async def mark_devices_shipped( # pylint: disable=inconsistent-return-statement self, job_name: str, resource_group_name: str, - mark_devices_shipped_request: IO, + mark_devices_shipped_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -202,11 +198,10 @@ async def mark_devices_shipped( # pylint: disable=inconsistent-return-statement :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 + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -217,7 +212,7 @@ async def mark_devices_shipped( # pylint: disable=inconsistent-return-statement self, job_name: str, resource_group_name: str, - mark_devices_shipped_request: Union[_models.MarkDevicesShippedRequest, IO], + mark_devices_shipped_request: Union[_models.MarkDevicesShippedRequest, IO[bytes]], **kwargs: Any ) -> None: """Request to mark devices for a given job as shipped. @@ -229,18 +224,14 @@ async def mark_devices_shipped( # pylint: disable=inconsistent-return-statement :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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2022_12_01.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -251,19 +242,19 @@ async def mark_devices_shipped( # pylint: disable=inconsistent-return-statement _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", "2022-12-01")) + 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, (IO, bytes)): + 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( + _request = build_mark_devices_shipped_request( job_name=job_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -271,16 +262,14 @@ async def mark_devices_shipped( # pylint: disable=inconsistent-return-statement content_type=content_type, json=_json, content=_content, - template_url=self.mark_devices_shipped.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,11 +280,7 @@ async def mark_devices_shipped( # pylint: disable=inconsistent-return-statement raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def list_by_resource_group( @@ -308,19 +293,17 @@ def list_by_resource_group( :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :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", "2022-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,17 +314,15 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - request = build_list_by_resource_group_request( + _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, - template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -353,13 +334,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _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) @@ -369,11 +349,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -386,10 +366,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - @distributed_trace_async async def get( self, resource_group_name: str, job_name: str, expand: Optional[str] = None, **kwargs: Any @@ -405,12 +381,11 @@ async def get( :param expand: $expand is supported on details parameter for job, which provides details on the job stages. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.JobResource + :rtype: ~azure.mgmt.databox.models.JobResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -421,25 +396,23 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + 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( + _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, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,21 +422,21 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("JobResource", pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return deserialized # type: ignore async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { + self, + resource_group_name: str, + job_name: str, + job_resource: Union[_models.JobResource, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -474,19 +447,19 @@ async def _create_initial( _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", "2022-12-01")) + 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[Optional[_models.JobResource]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(job_resource, (IO, bytes)): + if isinstance(job_resource, (IOBase, bytes)): _content = job_resource else: _json = self._serialize.body(job_resource, "JobResource") - request = build_create_request( + _request = build_create_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, @@ -494,37 +467,34 @@ async def _create_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return deserialized # type: ignore @overload async def begin_create( @@ -546,21 +516,13 @@ async def begin_create( Required. :type job_name: str :param job_resource: Job details from request body. Required. - :type job_resource: ~azure.mgmt.databox.v2022_12_01.models.JobResource + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -569,7 +531,7 @@ async def begin_create( self, resource_group_name: str, job_name: str, - job_resource: IO, + job_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -584,27 +546,23 @@ async def begin_create( Required. :type job_name: str :param job_resource: Job details from request body. Required. - :type job_resource: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :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], **kwargs: Any + 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. @@ -615,29 +573,18 @@ async def begin_create( 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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2022_12_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + :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.v2022_12_01.models.JobResource] + :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", "2022-12-01")) + 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) @@ -655,12 +602,13 @@ async def begin_create( 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) + deserialized = self._deserialize("JobResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -670,22 +618,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return AsyncLROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { + async def _delete_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -696,29 +640,32 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) - cls: ClsType[None] = kwargs.pop("cls", None) + 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( + _request = build_delete_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _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) @@ -727,12 +674,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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, None, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return deserialized # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -744,14 +691,6 @@ async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: must be between 3 and 24 characters in length and use any alphanumeric and underscore only. Required. :type job_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -759,13 +698,13 @@ async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + 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( # type: ignore + raw_result = await self._delete_initial( resource_group_name=resource_group_name, job_name=job_name, api_version=api_version, @@ -774,11 +713,12 @@ async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: 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, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -787,27 +727,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + 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], + job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -818,19 +754,19 @@ async def _update_initial( _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", "2022-12-01")) + 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[Optional[_models.JobResource]] = kwargs.pop("cls", 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, (IO, bytes)): + 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( + _request = build_update_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, @@ -839,41 +775,38 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - if response.status_code == 202: response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - if cls: - return cls(pipeline_response, deserialized, response_headers) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - return deserialized + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return deserialized # type: ignore @overload async def begin_update( @@ -895,25 +828,16 @@ async def begin_update( 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.v2022_12_01.models.JobResourceUpdateParameter + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -922,7 +846,7 @@ async def begin_update( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: IO, + job_resource_update_parameter: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", @@ -937,24 +861,16 @@ async def begin_update( Required. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. Required. - :type job_resource_update_parameter: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -963,7 +879,7 @@ async def begin_update( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], + job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> AsyncLROPoller[_models.JobResource]: @@ -976,32 +892,21 @@ async def begin_update( Required. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. Is either a - JobResourceUpdateParameter type or a IO type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2022_12_01.models.JobResourceUpdateParameter or IO + 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 - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :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", "2022-12-01")) + 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) @@ -1020,12 +925,13 @@ async def begin_update( 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) + deserialized = self._deserialize("JobResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1035,17 +941,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return AsyncLROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def book_shipment_pick_up( @@ -1066,13 +970,12 @@ async def book_shipment_pick_up( 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.v2022_12_01.models.ShipmentPickUpRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1081,7 +984,7 @@ async def book_shipment_pick_up( self, resource_group_name: str, job_name: str, - shipment_pick_up_request: IO, + shipment_pick_up_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1095,13 +998,12 @@ async def book_shipment_pick_up( Required. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. Required. - :type shipment_pick_up_request: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1110,7 +1012,7 @@ async def book_shipment_pick_up( self, resource_group_name: str, job_name: str, - shipment_pick_up_request: Union[_models.ShipmentPickUpRequest, IO], + shipment_pick_up_request: Union[_models.ShipmentPickUpRequest, IO[bytes]], **kwargs: Any ) -> _models.ShipmentPickUpResponse: """Book shipment pick up. @@ -1122,18 +1024,13 @@ async def book_shipment_pick_up( Required. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. Is either a - ShipmentPickUpRequest type or a IO type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2022_12_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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.v2022_12_01.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1144,19 +1041,19 @@ async def book_shipment_pick_up( _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", "2022-12-01")) + 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, (IO, bytes)): + 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( + _request = build_book_shipment_pick_up_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, @@ -1164,16 +1061,14 @@ async def book_shipment_pick_up( content_type=content_type, json=_json, content=_content, - template_url=self.book_shipment_pick_up.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1183,16 +1078,12 @@ async def book_shipment_pick_up( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response) + deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } + return deserialized # type: ignore @overload async def cancel( # pylint: disable=inconsistent-return-statements @@ -1213,11 +1104,10 @@ async def cancel( # pylint: disable=inconsistent-return-statements Required. :type job_name: str :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2022_12_01.models.CancellationReason + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1228,7 +1118,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, job_name: str, - cancellation_reason: IO, + cancellation_reason: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1242,11 +1132,10 @@ async def cancel( # pylint: disable=inconsistent-return-statements Required. :type job_name: str :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1257,7 +1146,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], + cancellation_reason: Union[_models.CancellationReason, IO[bytes]], **kwargs: Any ) -> None: """CancelJob. @@ -1269,17 +1158,13 @@ async def cancel( # pylint: disable=inconsistent-return-statements Required. :type job_name: str :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2022_12_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1290,19 +1175,19 @@ async def cancel( # pylint: disable=inconsistent-return-statements _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", "2022-12-01")) + 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, (IO, bytes)): + if isinstance(cancellation_reason, (IOBase, bytes)): _content = cancellation_reason else: _json = self._serialize.body(cancellation_reason, "CancellationReason") - request = build_cancel_request( + _request = build_cancel_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, @@ -1310,16 +1195,14 @@ async def cancel( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self.cancel.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1330,11 +1213,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def list_credentials( @@ -1348,20 +1227,19 @@ def list_credentials( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. Required. :type job_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either UnencryptedCredentials or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_12_01.models.UnencryptedCredentials] + ~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", "2022-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1372,17 +1250,15 @@ def list_credentials( def prepare_request(next_link=None): if not next_link: - request = build_list_credentials_request( + _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, - template_url=self.list_credentials.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1394,13 +1270,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _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) @@ -1410,11 +1285,11 @@ async def extract_data(pipeline_response): return None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1426,7 +1301,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_operations.py similarity index 80% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_operations.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_operations.py index 186ed5d0fd28..b35a258ce157 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,16 +20,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest 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 ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,7 +42,7 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2020_04_01.aio.DataBoxManagementClient`'s + :class:`~azure.mgmt.databox.aio.DataBoxManagementClient`'s :attr:`operations` attribute. """ @@ -56,19 +59,17 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """This method gets all the operations. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.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 {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -79,14 +80,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -98,13 +97,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("OperationList", pipeline_response) @@ -114,11 +112,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -130,5 +128,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_patch.py similarity index 100% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_patch.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_patch.py diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_service_operations.py similarity index 72% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_service_operations.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_service_operations.py index e3ec2fd1edeb..ae04046ce90b 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_service_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/operations/_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,15 +21,13 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ..._vendor import _convert_request from ...operations._service_operations import ( build_list_available_skus_by_resource_group_request, build_region_configuration_by_resource_group_request, @@ -37,6 +37,10 @@ build_validate_inputs_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +51,7 @@ class ServiceOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2020_04_01.aio.DataBoxManagementClient`'s + :class:`~azure.mgmt.databox.aio.DataBoxManagementClient`'s :attr:`service` attribute. """ @@ -78,14 +82,12 @@ def list_available_skus_by_resource_group( :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.v2020_04_01.models.AvailableSkuRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.SkuInformation] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -94,7 +96,7 @@ def list_available_skus_by_resource_group( self, resource_group_name: str, location: str, - available_sku_request: IO, + available_sku_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -107,14 +109,12 @@ def list_available_skus_by_resource_group( :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 + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.SkuInformation] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -123,7 +123,7 @@ def list_available_skus_by_resource_group( self, resource_group_name: str, location: str, - available_sku_request: Union[_models.AvailableSkuRequest, IO], + 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 @@ -134,25 +134,20 @@ def list_available_skus_by_resource_group( :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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2020_04_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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.v2020_04_01.models.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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +157,7 @@ def list_available_skus_by_resource_group( content_type = content_type or "application/json" _json = None _content = None - if isinstance(available_sku_request, (IO, bytes)): + if isinstance(available_sku_request, (IOBase, bytes)): _content = available_sku_request else: _json = self._serialize.body(available_sku_request, "AvailableSkuRequest") @@ -170,7 +165,7 @@ def list_available_skus_by_resource_group( def prepare_request(next_link=None): if not next_link: - request = build_list_available_skus_by_resource_group_request( + _request = build_list_available_skus_by_resource_group_request( resource_group_name=resource_group_name, location=location, subscription_id=self._config.subscription_id, @@ -178,12 +173,10 @@ def prepare_request(next_link=None): content_type=content_type, json=_json, content=_content, - template_url=self.list_available_skus_by_resource_group.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -195,13 +188,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _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) @@ -211,11 +203,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,10 +220,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - @overload async def validate_address( self, @@ -247,19 +235,18 @@ async def validate_address( :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.v2020_04_01.models.ValidateAddress + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def validate_address( - self, location: str, validate_address: IO, *, content_type: str = "application/json", **kwargs: Any + 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. @@ -267,19 +254,18 @@ async def validate_address( :param location: The location of the resource. Required. :type location: str :param validate_address: Shipping address of the customer. Required. - :type validate_address: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput + :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], **kwargs: Any + 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. @@ -287,17 +273,13 @@ async def validate_address( :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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2020_04_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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.v2020_04_01.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -308,35 +290,33 @@ async def validate_address( _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", "2020-04-01")) + 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, (IO, bytes)): + if isinstance(validate_address, (IOBase, bytes)): _content = validate_address else: _json = self._serialize.body(validate_address, "ValidateAddress") - request = build_validate_address_request( + _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, - template_url=self.validate_address.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -346,16 +326,12 @@ async def validate_address( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AddressValidationOutput", pipeline_response) + deserialized = self._deserialize("AddressValidationOutput", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } + return deserialized # type: ignore @overload async def validate_inputs_by_resource_group( @@ -374,13 +350,12 @@ async def validate_inputs_by_resource_group( :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.v2020_04_01.models.ValidationRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse + :rtype: ~azure.mgmt.databox.models.ValidationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -389,7 +364,7 @@ async def validate_inputs_by_resource_group( self, resource_group_name: str, location: str, - validation_request: IO, + validation_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -401,13 +376,12 @@ async def validate_inputs_by_resource_group( :param location: The location of the resource. Required. :type location: str :param validation_request: Inputs of the customer. Required. - :type validation_request: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse + :rtype: ~azure.mgmt.databox.models.ValidationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -416,7 +390,7 @@ async def validate_inputs_by_resource_group( self, resource_group_name: str, location: str, - validation_request: Union[_models.ValidationRequest, IO], + validation_request: Union[_models.ValidationRequest, IO[bytes]], **kwargs: Any ) -> _models.ValidationResponse: """This method does all necessary pre-job creation validation under resource group. @@ -425,18 +399,14 @@ async def validate_inputs_by_resource_group( :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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :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.v2020_04_01.models.ValidationResponse + :rtype: ~azure.mgmt.databox.models.ValidationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,19 +417,19 @@ async def validate_inputs_by_resource_group( _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", "2020-04-01")) + 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, (IO, bytes)): + 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( + _request = build_validate_inputs_by_resource_group_request( resource_group_name=resource_group_name, location=location, subscription_id=self._config.subscription_id, @@ -467,16 +437,14 @@ async def validate_inputs_by_resource_group( content_type=content_type, json=_json, content=_content, - template_url=self.validate_inputs_by_resource_group.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -486,16 +454,12 @@ async def validate_inputs_by_resource_group( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("ValidationResponse", pipeline_response) + deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } + return deserialized # type: ignore @overload async def validate_inputs( @@ -511,55 +475,49 @@ async def validate_inputs( :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.v2020_04_01.models.ValidationRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse + :rtype: ~azure.mgmt.databox.models.ValidationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def validate_inputs( - self, location: str, validation_request: IO, *, content_type: str = "application/json", **kwargs: Any + 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 + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse + :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], **kwargs: Any + 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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :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.v2020_04_01.models.ValidationResponse + :rtype: ~azure.mgmt.databox.models.ValidationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -570,35 +528,33 @@ async def validate_inputs( _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", "2020-04-01")) + 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, (IO, bytes)): + if isinstance(validation_request, (IOBase, bytes)): _content = validation_request else: _json = self._serialize.body(validation_request, "ValidationRequest") - request = build_validate_inputs_request( + _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, - template_url=self.validate_inputs.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,16 +564,12 @@ async def validate_inputs( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("ValidationResponse", pipeline_response) + deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } + return deserialized # type: ignore @overload async def region_configuration( @@ -635,20 +587,23 @@ async def region_configuration( :type location: str :param region_configuration_request: Request body to get the configuration for the region. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def region_configuration( - self, location: str, region_configuration_request: IO, *, content_type: str = "application/json", **kwargs: Any + 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. @@ -657,19 +612,21 @@ async def region_configuration( :type location: str :param region_configuration_request: Request body to get the configuration for the region. Required. - :type region_configuration_request: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse + :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], **kwargs: Any + 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. @@ -677,18 +634,14 @@ async def region_configuration( :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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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.v2020_04_01.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -699,35 +652,33 @@ async def region_configuration( _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", "2020-04-01")) + 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, (IO, bytes)): + 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( + _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, - template_url=self.region_configuration.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -737,16 +688,12 @@ async def region_configuration( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response) + deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } + return deserialized # type: ignore @overload async def region_configuration_by_resource_group( @@ -767,14 +714,12 @@ async def region_configuration_by_resource_group( :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.v2020_04_01.models.RegionConfigurationRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -783,7 +728,7 @@ async def region_configuration_by_resource_group( self, resource_group_name: str, location: str, - region_configuration_request: IO, + region_configuration_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -797,13 +742,12 @@ async def region_configuration_by_resource_group( :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 + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -812,7 +756,7 @@ async def region_configuration_by_resource_group( self, resource_group_name: str, location: str, - region_configuration_request: Union[_models.RegionConfigurationRequest, IO], + 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 @@ -823,18 +767,15 @@ async def region_configuration_by_resource_group( :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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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.v2020_04_01.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -845,19 +786,19 @@ async def region_configuration_by_resource_group( _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", "2020-04-01")) + 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, (IO, bytes)): + 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( + _request = build_region_configuration_by_resource_group_request( resource_group_name=resource_group_name, location=location, subscription_id=self._config.subscription_id, @@ -865,16 +806,14 @@ async def region_configuration_by_resource_group( content_type=content_type, json=_json, content=_content, - template_url=self.region_configuration_by_resource_group.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -884,13 +823,9 @@ async def region_configuration_by_resource_group( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response) + deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } + return deserialized # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models.py deleted file mode 100644 index 9b63e14258de..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models.py +++ /dev/null @@ -1,7 +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. -# -------------------------------------------------------------------------- -from .v2022_12_01.models import * diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/__init__.py similarity index 100% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/__init__.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/__init__.py diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_data_box_management_client_enums.py similarity index 99% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/_data_box_management_client_enums.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_data_box_management_client_enums.py index 2e8d813018ec..0795de2c3514 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/_data_box_management_client_enums.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_data_box_management_client_enums.py @@ -287,7 +287,7 @@ class ReverseShippingDetailsEditStatus(str, Enum, metaclass=CaseInsensitiveEnumM """Edit is disabled for Reverse shipping details.""" NOT_SUPPORTED = "NotSupported" """Edit is not supported for Reverse shipping details. Either subscription feature is not - #: available or SKU doesn't support this feature.""" + available or SKU doesn't support this feature.""" class ReverseTransportPreferenceEditStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -299,7 +299,7 @@ class ReverseTransportPreferenceEditStatus(str, Enum, metaclass=CaseInsensitiveE """Edit is disabled for Reverse Transport Preferences.""" NOT_SUPPORTED = "NotSupported" """Edit is not supported for Reverse Transport Preferences. Either subscription feature is not - #: available or SKU doesn't support this feature.""" + available or SKU doesn't support this feature.""" class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -334,7 +334,7 @@ class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Subscription does not have required offer types for the SKU.""" NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" + notification.""" class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_models_py3.py similarity index 87% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/_models_py3.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_models_py3.py index 402150fd5ed6..ed580288b3ed 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/_models_py3.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_models_py3.py @@ -9,18 +9,14 @@ import datetime import sys -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Literal, Optional, TYPE_CHECKING, Union -from ... import _serialization +from .. import _serialization if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,13 +33,12 @@ class AccountCredentialDetails(_serialization.Model): :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.v2022_12_01.models.DataAccountType + :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.v2022_12_01.models.ShareCredentialDetails] + :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] """ _validation = { @@ -103,16 +98,14 @@ class AddressValidationOutput(_serialization.Model): :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.v2022_12_01.models.ValidationInputDiscriminator + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.AddressValidationStatus + :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2022_12_01.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] """ _validation = { @@ -148,15 +141,14 @@ class ValidationInputResponse(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :vartype error: ~azure.mgmt.databox.models.CloudError """ _validation = { @@ -192,21 +184,19 @@ class AddressValidationProperties(ValidationInputResponse): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.AddressValidationStatus + :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2022_12_01.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] """ _validation = { @@ -234,10 +224,10 @@ def __init__(self, **kwargs: Any) -> None: class ApiError(_serialization.Model): """ApiError. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar error: Required. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.ErrorDetail + :vartype error: ~azure.mgmt.databox.models.ErrorDetail """ _validation = { @@ -251,7 +241,7 @@ class ApiError(_serialization.Model): def __init__(self, *, error: "_models.ErrorDetail", **kwargs: Any) -> None: """ :keyword error: Required. - :paramtype error: ~azure.mgmt.databox.v2022_12_01.models.ErrorDetail + :paramtype error: ~azure.mgmt.databox.models.ErrorDetail """ super().__init__(**kwargs) self.error = error @@ -321,11 +311,11 @@ def __init__(self, **kwargs: Any) -> None: class AvailableSkuRequest(_serialization.Model): """The filters for showing the available skus. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.TransferType + :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 @@ -334,7 +324,7 @@ class AvailableSkuRequest(_serialization.Model): Required. :vartype location: str :ivar sku_names: Sku Names to filter for available skus. - :vartype sku_names: list[str or ~azure.mgmt.databox.v2022_12_01.models.SkuName] + :vartype sku_names: list[str or ~azure.mgmt.databox.models.SkuName] """ _validation = { @@ -362,7 +352,7 @@ def __init__( """ :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2022_12_01.models.TransferType + :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 @@ -371,7 +361,7 @@ def __init__( Required. :paramtype location: str :keyword sku_names: Sku Names to filter for available skus. - :paramtype sku_names: list[str or ~azure.mgmt.databox.v2022_12_01.models.SkuName] + :paramtype sku_names: list[str or ~azure.mgmt.databox.models.SkuName] """ super().__init__(**kwargs) self.transfer_type = transfer_type @@ -386,7 +376,7 @@ class AvailableSkusResult(_serialization.Model): 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.v2022_12_01.models.SkuInformation] + :vartype value: list[~azure.mgmt.databox.models.SkuInformation] :ivar next_link: Link for the next set of skus. :vartype next_link: str """ @@ -491,7 +481,7 @@ def __init__( class CancellationReason(_serialization.Model): """Reason for cancellation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar reason: Reason for cancellation. Required. :vartype reason: str @@ -520,11 +510,11 @@ class CloudError(_serialization.Model): 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.v2022_12_01.models.AdditionalErrorInfo] + :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.v2022_12_01.models.CloudError] + :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. @@ -566,7 +556,7 @@ def __init__( class ContactDetails(_serialization.Model): """Contact Details. - All required parameters must be populated in order to send to Azure. + 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 @@ -579,8 +569,7 @@ class ContactDetails(_serialization.Model): :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.v2022_12_01.models.NotificationPreference] + :vartype notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] """ _validation = { @@ -621,8 +610,7 @@ def __init__( :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.v2022_12_01.models.NotificationPreference] + :paramtype notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] """ super().__init__(**kwargs) self.contact_name = contact_name @@ -636,7 +624,7 @@ def __init__( class ContactInfo(_serialization.Model): """Contact Info. - All required parameters must be populated in order to send to Azure. + 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 @@ -693,12 +681,11 @@ class CopyLogDetails(_serialization.Model): DataBoxAccountCopyLogDetails, DataBoxCustomerDiskCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ClassDiscriminator + :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator """ _validation = { @@ -734,10 +721,10 @@ class CopyProgress(_serialization.Model): # pylint: disable=too-many-instance-a :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.v2022_12_01.models.TransferType + :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.v2022_12_01.models.DataAccountType + :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. @@ -767,9 +754,9 @@ class CopyProgress(_serialization.Model): # pylint: disable=too-many-instance-a 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.v2022_12_01.models.CloudError + :vartype error: ~azure.mgmt.databox.models.CloudError :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.v2022_12_01.models.CustomerResolutionCode] + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] """ _validation = { @@ -840,15 +827,14 @@ class ValidationRequest(_serialization.Model): 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 Azure. + 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.v2022_12_01.models.ValidationInputRequest] + :vartype individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] """ _validation = { @@ -867,8 +853,7 @@ def __init__(self, *, individual_request_details: List["_models.ValidationInputR """ :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.v2022_12_01.models.ValidationInputRequest] + :paramtype individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] """ super().__init__(**kwargs) self.validation_category: Optional[str] = None @@ -878,15 +863,14 @@ def __init__(self, *, individual_request_details: List["_models.ValidationInputR class CreateJobValidations(ValidationRequest): """It does all pre-job creation validations. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ValidationInputRequest] + :vartype individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] """ _validation = { @@ -903,8 +887,7 @@ def __init__(self, *, individual_request_details: List["_models.ValidationInputR """ :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.v2022_12_01.models.ValidationInputRequest] + :paramtype individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] """ super().__init__(individual_request_details=individual_request_details, **kwargs) self.validation_category: str = "JobCreationValidation" @@ -918,13 +901,12 @@ class ValidationInputRequest(_serialization.Model): DataTransferDetailsValidationRequest, PreferencesValidationRequest, SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator """ _validation = { @@ -952,19 +934,18 @@ def __init__(self, **kwargs: Any) -> None: self.validation_type: Optional[str] = None -class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): +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 Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :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.v2022_12_01.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.models.SkuName """ _validation = { @@ -981,30 +962,31 @@ def __init__(self, *, device_type: Union[str, "_models.SkuName"], **kwargs: Any) """ :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.v2022_12_01.models.SkuName + :paramtype device_type: str or ~azure.mgmt.databox.models.SkuName """ super().__init__(**kwargs) self.validation_type: str = "ValidateCreateOrderLimit" self.device_type = device_type -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): +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 Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus """ _validation = { @@ -1034,15 +1016,15 @@ class JobSecrets(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ClassDiscriminator + :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.v2022_12_01.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :vartype error: ~azure.mgmt.databox.models.CloudError """ _validation = { @@ -1079,17 +1061,17 @@ class CustomerDiskJobSecrets(JobSecrets): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ClassDiscriminator + :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.v2022_12_01.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.DiskSecret] + :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] :ivar carrier_account_number: Carrier Account Number of the customer. :vartype carrier_account_number: str """ @@ -1124,11 +1106,11 @@ class DataAccountDetails(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ManagedDiskDetails, StorageAccountDetails - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.DataAccountType + :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 @@ -1171,12 +1153,11 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ClassDiscriminator + :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. @@ -1214,12 +1195,11 @@ class DataBoxCustomerDiskCopyLogDetails(CopyLogDetails): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ClassDiscriminator + :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. @@ -1261,10 +1241,10 @@ class DataBoxCustomerDiskCopyProgress(CopyProgress): # pylint: disable=too-many :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.v2022_12_01.models.TransferType + :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.v2022_12_01.models.DataAccountType + :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. @@ -1294,9 +1274,9 @@ class DataBoxCustomerDiskCopyProgress(CopyProgress): # pylint: disable=too-many 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.v2022_12_01.models.CloudError + :vartype error: ~azure.mgmt.databox.models.CloudError :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.v2022_12_01.models.CustomerResolutionCode] + :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", @@ -1304,7 +1284,7 @@ class DataBoxCustomerDiskCopyProgress(CopyProgress): # pylint: disable=too-many "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". - :vartype copy_status: str or ~azure.mgmt.databox.v2022_12_01.models.CopyStatus + :vartype copy_status: str or ~azure.mgmt.databox.models.CopyStatus """ _validation = { @@ -1366,51 +1346,49 @@ class JobDetails(_serialization.Model): # pylint: disable=too-many-instance-att Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.JobStages] + :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.v2022_12_01.models.ContactDetails + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_12_01.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_12_01.models.PackageShippingDetails + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.DataExportDetails] + :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.v2022_12_01.models.ClassDiscriminator + :vartype job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :vartype preferences: ~azure.mgmt.databox.models.Preferences :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_12_01.models.ReverseShippingDetails + :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.v2022_12_01.models.CopyLogDetails] + :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.v2022_12_01.models.DeviceErasureDetails + :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.v2022_12_01.models.KeyEncryptionKey + :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.v2022_12_01.models.CustomerResolutionCode] + :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.v2022_12_01.models.LastMitigationActionOnJob + :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.v2022_12_01.models.DatacenterAddressResponse + :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", @@ -1418,7 +1396,7 @@ class JobDetails(_serialization.Model): # pylint: disable=too-many-instance-att "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_12_01.models.DataCenterCode + :vartype data_center_code: str or ~azure.mgmt.databox.models.DataCenterCode """ _validation = { @@ -1484,20 +1462,19 @@ def __init__( ) -> None: """ :keyword contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2022_12_01.models.ContactDetails + :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.DataExportDetails] + :paramtype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :paramtype preferences: ~azure.mgmt.databox.models.Preferences :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_12_01.models.ReverseShippingDetails + :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.v2022_12_01.models.KeyEncryptionKey + :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 @@ -1530,51 +1507,49 @@ class DataBoxCustomerDiskJobDetails(JobDetails): # pylint: disable=too-many-ins Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.JobStages] + :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.v2022_12_01.models.ContactDetails + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_12_01.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_12_01.models.PackageShippingDetails + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.DataExportDetails] + :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.v2022_12_01.models.ClassDiscriminator + :vartype job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :vartype preferences: ~azure.mgmt.databox.models.Preferences :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_12_01.models.ReverseShippingDetails + :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.v2022_12_01.models.CopyLogDetails] + :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.v2022_12_01.models.DeviceErasureDetails + :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.v2022_12_01.models.KeyEncryptionKey + :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.v2022_12_01.models.CustomerResolutionCode] + :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.v2022_12_01.models.LastMitigationActionOnJob + :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.v2022_12_01.models.DatacenterAddressResponse + :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", @@ -1582,24 +1557,21 @@ class DataBoxCustomerDiskJobDetails(JobDetails): # pylint: disable=too-many-ins "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_12_01.models.DataCenterCode + :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.v2022_12_01.models.ImportDiskDetails] + ~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.v2022_12_01.models.ExportDiskDetails] + ~azure.mgmt.databox.models.ExportDiskDetails] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: - list[~azure.mgmt.databox.v2022_12_01.models.DataBoxCustomerDiskCopyProgress] + :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.v2022_12_01.models.PackageCarrierInfo + :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.v2022_12_01.models.PackageCarrierDetails + :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 @@ -1675,30 +1647,28 @@ def __init__( # pylint: disable=too-many-locals ) -> None: """ :keyword contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2022_12_01.models.ContactDetails + :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.DataExportDetails] + :paramtype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :paramtype preferences: ~azure.mgmt.databox.models.Preferences :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_12_01.models.ReverseShippingDetails + :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.v2022_12_01.models.KeyEncryptionKey + :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.v2022_12_01.models.ImportDiskDetails] + ~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.v2022_12_01.models.PackageCarrierDetails + :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 @@ -1728,12 +1698,11 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ClassDiscriminator + :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. @@ -1781,11 +1750,11 @@ class DataBoxDiskCopyProgress(_serialization.Model): "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". - :vartype status: str or ~azure.mgmt.databox.v2022_12_01.models.CopyStatus + :vartype status: str or ~azure.mgmt.databox.models.CopyStatus :ivar error: Error, if any, in the stage. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :vartype error: ~azure.mgmt.databox.models.CloudError :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.v2022_12_01.models.CustomerResolutionCode] + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] """ _validation = { @@ -1823,12 +1792,11 @@ class GranularCopyLogDetails(_serialization.Model): 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 Azure. + 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.v2022_12_01.models.ClassDiscriminator + :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator """ _validation = { @@ -1852,12 +1820,11 @@ class DataBoxDiskGranularCopyLogDetails(GranularCopyLogDetails): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ClassDiscriminator + :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. @@ -1904,10 +1871,10 @@ class GranularCopyProgress(_serialization.Model): # pylint: disable=too-many-in :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.v2022_12_01.models.TransferType + :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.v2022_12_01.models.DataAccountType + :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. @@ -1937,9 +1904,9 @@ class GranularCopyProgress(_serialization.Model): # pylint: disable=too-many-in 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.v2022_12_01.models.CloudError + :vartype error: ~azure.mgmt.databox.models.CloudError :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.v2022_12_01.models.CustomerResolutionCode] + :vartype actions: list[str or ~azure.mgmt.databox.models.CustomerResolutionCode] """ _validation = { @@ -2014,10 +1981,10 @@ class DataBoxDiskGranularCopyProgress(GranularCopyProgress): # pylint: disable= :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.v2022_12_01.models.TransferType + :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.v2022_12_01.models.DataAccountType + :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. @@ -2047,9 +2014,9 @@ class DataBoxDiskGranularCopyProgress(GranularCopyProgress): # pylint: disable= 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.v2022_12_01.models.CloudError + :vartype error: ~azure.mgmt.databox.models.CloudError :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.v2022_12_01.models.CustomerResolutionCode] + :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", @@ -2057,7 +2024,7 @@ class DataBoxDiskGranularCopyProgress(GranularCopyProgress): # pylint: disable= "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", "DriveNotDetected", "DriveCorrupted", and "MetadataFilesModifiedOrRemoved". - :vartype copy_status: str or ~azure.mgmt.databox.v2022_12_01.models.CopyStatus + :vartype copy_status: str or ~azure.mgmt.databox.models.CopyStatus """ _validation = { @@ -2116,51 +2083,49 @@ class DataBoxDiskJobDetails(JobDetails): # pylint: disable=too-many-instance-at Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.JobStages] + :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.v2022_12_01.models.ContactDetails + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_12_01.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_12_01.models.PackageShippingDetails + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.DataExportDetails] + :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.v2022_12_01.models.ClassDiscriminator + :vartype job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :vartype preferences: ~azure.mgmt.databox.models.Preferences :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_12_01.models.ReverseShippingDetails + :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.v2022_12_01.models.CopyLogDetails] + :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.v2022_12_01.models.DeviceErasureDetails + :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.v2022_12_01.models.KeyEncryptionKey + :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.v2022_12_01.models.CustomerResolutionCode] + :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.v2022_12_01.models.LastMitigationActionOnJob + :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.v2022_12_01.models.DatacenterAddressResponse + :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", @@ -2168,19 +2133,19 @@ class DataBoxDiskJobDetails(JobDetails): # pylint: disable=too-many-instance-at "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_12_01.models.DataCenterCode + :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.v2022_12_01.models.DataBoxDiskCopyProgress] + :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.v2022_12_01.models.DataBoxDiskGranularCopyProgress] + list[~azure.mgmt.databox.models.DataBoxDiskGranularCopyProgress] :ivar granular_copy_log_details: Copy progress per disk. :vartype granular_copy_log_details: - list[~azure.mgmt.databox.v2022_12_01.models.DataBoxDiskGranularCopyLogDetails] + 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] @@ -2254,20 +2219,19 @@ def __init__( # pylint: disable=too-many-locals ) -> None: """ :keyword contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2022_12_01.models.ContactDetails + :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.DataExportDetails] + :paramtype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :paramtype preferences: ~azure.mgmt.databox.models.Preferences :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_12_01.models.ReverseShippingDetails + :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.v2022_12_01.models.KeyEncryptionKey + :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 @@ -2303,17 +2267,17 @@ class DataBoxDiskJobSecrets(JobSecrets): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ClassDiscriminator + :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.v2022_12_01.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.DiskSecret] + :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. @@ -2352,12 +2316,11 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ClassDiscriminator + :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. @@ -2395,51 +2358,49 @@ class DataBoxHeavyJobDetails(JobDetails): # pylint: disable=too-many-instance-a Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.JobStages] + :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.v2022_12_01.models.ContactDetails + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_12_01.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_12_01.models.PackageShippingDetails + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.DataExportDetails] + :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.v2022_12_01.models.ClassDiscriminator + :vartype job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :vartype preferences: ~azure.mgmt.databox.models.Preferences :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_12_01.models.ReverseShippingDetails + :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.v2022_12_01.models.CopyLogDetails] + :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.v2022_12_01.models.DeviceErasureDetails + :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.v2022_12_01.models.KeyEncryptionKey + :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.v2022_12_01.models.CustomerResolutionCode] + :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.v2022_12_01.models.LastMitigationActionOnJob + :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.v2022_12_01.models.DatacenterAddressResponse + :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", @@ -2447,9 +2408,9 @@ class DataBoxHeavyJobDetails(JobDetails): # pylint: disable=too-many-instance-a "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_12_01.models.DataCenterCode + :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.v2022_12_01.models.CopyProgress] + :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 @@ -2517,20 +2478,19 @@ def __init__( ) -> None: """ :keyword contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2022_12_01.models.ContactDetails + :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.DataExportDetails] + :paramtype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :paramtype preferences: ~azure.mgmt.databox.models.Preferences :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_12_01.models.ReverseShippingDetails + :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.v2022_12_01.models.KeyEncryptionKey + :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 @@ -2563,17 +2523,17 @@ class DataBoxHeavyJobSecrets(JobSecrets): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ClassDiscriminator + :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.v2022_12_01.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.DataBoxHeavySecret] + :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] """ _validation = { @@ -2607,14 +2567,12 @@ class DataBoxHeavySecret(_serialization.Model): :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.v2022_12_01.models.ApplianceNetworkConfiguration] + :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.v2022_12_01.models.AccountCredentialDetails] + :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] """ _validation = { @@ -2648,51 +2606,49 @@ class DataBoxJobDetails(JobDetails): # pylint: disable=too-many-instance-attrib Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.JobStages] + :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.v2022_12_01.models.ContactDetails + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :vartype shipping_address: ~azure.mgmt.databox.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_12_01.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_12_01.models.PackageShippingDetails + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.DataExportDetails] + :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.v2022_12_01.models.ClassDiscriminator + :vartype job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :vartype preferences: ~azure.mgmt.databox.models.Preferences :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_12_01.models.ReverseShippingDetails + :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.v2022_12_01.models.CopyLogDetails] + :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.v2022_12_01.models.DeviceErasureDetails + :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.v2022_12_01.models.KeyEncryptionKey + :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.v2022_12_01.models.CustomerResolutionCode] + :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.v2022_12_01.models.LastMitigationActionOnJob + :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.v2022_12_01.models.DatacenterAddressResponse + :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", @@ -2700,9 +2656,9 @@ class DataBoxJobDetails(JobDetails): # pylint: disable=too-many-instance-attrib "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", "PUS20", "AdHoc", "CH1", "DSM05", "DUB07", "PNQ01", "SVG20", "OSA02", "OSA22", "PAR22", "BN7", "SN6", and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_12_01.models.DataCenterCode + :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.v2022_12_01.models.CopyProgress] + :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 @@ -2770,20 +2726,19 @@ def __init__( ) -> None: """ :keyword contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2022_12_01.models.ContactDetails + :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.DataExportDetails] + :paramtype data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :paramtype preferences: ~azure.mgmt.databox.models.Preferences :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_12_01.models.ReverseShippingDetails + :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.v2022_12_01.models.KeyEncryptionKey + :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 @@ -2816,17 +2771,17 @@ class DataboxJobSecrets(JobSecrets): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ClassDiscriminator + :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.v2022_12_01.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.DataBoxSecret] + :vartype pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] """ _validation = { @@ -2845,7 +2800,7 @@ class DataboxJobSecrets(JobSecrets): 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.v2022_12_01.models.DataBoxSecret] + :paramtype pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] """ super().__init__(**kwargs) self.job_secrets_type: str = "DataBox" @@ -2859,7 +2814,7 @@ class ScheduleAvailabilityRequest(_serialization.Model): DataBoxScheduleAvailabilityRequest, DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest - All required parameters must be populated in order to send to Azure. + 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. @@ -2867,7 +2822,7 @@ class ScheduleAvailabilityRequest(_serialization.Model): :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.v2022_12_01.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName :ivar country: Country in which storage location should be supported. :vartype country: str """ @@ -2909,7 +2864,7 @@ def __init__(self, *, storage_location: str, country: Optional[str] = None, **kw 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 Azure. + 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. @@ -2917,7 +2872,7 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): :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.v2022_12_01.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName :ivar country: Country in which storage location should be supported. :vartype country: str """ @@ -2956,14 +2911,12 @@ class DataBoxSecret(_serialization.Model): :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.v2022_12_01.models.ApplianceNetworkConfiguration] + :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.v2022_12_01.models.AccountCredentialDetails] + :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] """ _validation = { @@ -3000,12 +2953,11 @@ class DatacenterAddressResponse(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.DatacenterAddressType + :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. @@ -3044,12 +2996,11 @@ class DatacenterAddressInstructionResponse(DatacenterAddressResponse): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.DatacenterAddressType + :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. @@ -3084,12 +3035,11 @@ class DatacenterAddressLocationResponse(DatacenterAddressResponse): # pylint: d Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.DatacenterAddressType + :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. @@ -3182,7 +3132,7 @@ def __init__(self, **kwargs: Any) -> None: class DatacenterAddressRequest(_serialization.Model): """Request body to get the datacenter address. - All required parameters must be populated in order to send to Azure. + 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. @@ -3190,7 +3140,7 @@ class DatacenterAddressRequest(_serialization.Model): :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.v2022_12_01.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName """ _validation = { @@ -3211,7 +3161,7 @@ def __init__(self, *, storage_location: str, sku_name: Union[str, "_models.SkuNa :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.v2022_12_01.models.SkuName + :paramtype sku_name: str or ~azure.mgmt.databox.models.SkuName """ super().__init__(**kwargs) self.storage_location = storage_location @@ -3221,15 +3171,15 @@ def __init__(self, *, storage_location: str, sku_name: Union[str, "_models.SkuNa 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 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.v2022_12_01.models.TransferConfiguration + :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.v2022_12_01.models.LogCollectionLevel + :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.v2022_12_01.models.DataAccountDetails + :vartype account_details: ~azure.mgmt.databox.models.DataAccountDetails """ _validation = { @@ -3253,13 +3203,12 @@ def __init__( ) -> None: """ :keyword transfer_configuration: Configuration for the data transfer. Required. - :paramtype transfer_configuration: ~azure.mgmt.databox.v2022_12_01.models.TransferConfiguration + :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.v2022_12_01.models.LogCollectionLevel + :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.v2022_12_01.models.DataAccountDetails + :paramtype account_details: ~azure.mgmt.databox.models.DataAccountDetails """ super().__init__(**kwargs) self.transfer_configuration = transfer_configuration @@ -3270,13 +3219,13 @@ def __init__( 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 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.v2022_12_01.models.DataAccountDetails + :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.v2022_12_01.models.LogCollectionLevel + :vartype log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel """ _validation = { @@ -3297,11 +3246,10 @@ def __init__( ) -> None: """ :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2022_12_01.models.DataAccountDetails + :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.v2022_12_01.models.LogCollectionLevel + :paramtype log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel """ super().__init__(**kwargs) self.account_details = account_details @@ -3339,23 +3287,22 @@ def __init__(self, **kwargs: Any) -> None: class DataTransferDetailsValidationRequest(ValidationInputRequest): """Request to validate export and import data details. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :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.v2022_12_01.models.DataExportDetails] + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.SkuName + :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.v2022_12_01.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType """ _validation = { @@ -3384,15 +3331,15 @@ def __init__( """ :keyword data_export_details: List of DataTransfer details to be used to export data from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_12_01.models.DataExportDetails] + :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.v2022_12_01.models.DataImportDetails] + :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.v2022_12_01.models.SkuName + :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.v2022_12_01.models.TransferType + :paramtype transfer_type: str or ~azure.mgmt.databox.models.TransferType """ super().__init__(**kwargs) self.validation_type: str = "ValidateDataTransferDetails" @@ -3402,23 +3349,22 @@ def __init__( self.transfer_type = transfer_type -class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): +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 Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus """ _validation = { @@ -3475,7 +3421,7 @@ def __init__( class Details(_serialization.Model): """Details. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar code: Required. :vartype code: str @@ -3515,7 +3461,7 @@ class DeviceErasureDetails(_serialization.Model): "WaitingForCustomerAction", "SucceededWithWarnings", "WaitingForCustomerActionForKek", "WaitingForCustomerActionForCleanUp", "CustomerActionPerformedForCleanUp", and "CustomerActionPerformed". - :vartype device_erasure_status: str or ~azure.mgmt.databox.v2022_12_01.models.StageStatus + :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 @@ -3541,7 +3487,7 @@ def __init__(self, **kwargs: Any) -> 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 Azure. + 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. @@ -3549,7 +3495,7 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): :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.v2022_12_01.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName :ivar country: Country in which storage location should be supported. :vartype country: str :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be @@ -3628,10 +3574,10 @@ class EncryptionPreferences(_serialization.Model): :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.v2022_12_01.models.DoubleEncryption + :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.v2022_12_01.models.HardwareEncryption + :vartype hardware_encryption: str or ~azure.mgmt.databox.models.HardwareEncryption """ _attribute_map = { @@ -3649,11 +3595,10 @@ def __init__( """ :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.v2022_12_01.models.DoubleEncryption + :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.v2022_12_01.models.HardwareEncryption + :paramtype hardware_encryption: str or ~azure.mgmt.databox.models.HardwareEncryption """ super().__init__(**kwargs) self.double_encryption = double_encryption @@ -3663,14 +3608,14 @@ def __init__( class ErrorDetail(_serialization.Model): """ErrorDetail. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.Details] + :vartype details: list[~azure.mgmt.databox.models.Details] :ivar target: :vartype target: str """ @@ -3702,7 +3647,7 @@ def __init__( :keyword message: Required. :paramtype message: str :keyword details: - :paramtype details: list[~azure.mgmt.databox.v2022_12_01.models.Details] + :paramtype details: list[~azure.mgmt.databox.models.Details] :keyword target: :paramtype target: str """ @@ -3750,11 +3695,11 @@ def __init__(self, **kwargs: Any) -> 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 Azure. + 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.v2022_12_01.models.FilterFileType + :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 @@ -3776,7 +3721,7 @@ def __init__( """ :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.v2022_12_01.models.FilterFileType + :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 @@ -3789,7 +3734,7 @@ def __init__( class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): """Request body to get the availability for scheduling heavy orders. - All required parameters must be populated in order to send to Azure. + 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. @@ -3797,7 +3742,7 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): :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.v2022_12_01.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName :ivar country: Country in which storage location should be supported. :vartype country: str """ @@ -3832,7 +3777,7 @@ class IdentityProperties(_serialization.Model): :ivar type: Managed service identity type. :vartype type: str :ivar user_assigned: User assigned identity properties. - :vartype user_assigned: ~azure.mgmt.databox.v2022_12_01.models.UserAssignedProperties + :vartype user_assigned: ~azure.mgmt.databox.models.UserAssignedProperties """ _attribute_map = { @@ -3851,7 +3796,7 @@ def __init__( :keyword type: Managed service identity type. :paramtype type: str :keyword user_assigned: User assigned identity properties. - :paramtype user_assigned: ~azure.mgmt.databox.v2022_12_01.models.UserAssignedProperties + :paramtype user_assigned: ~azure.mgmt.databox.models.UserAssignedProperties """ super().__init__(**kwargs) self.type = type @@ -3863,7 +3808,7 @@ class ImportDiskDetails(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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 @@ -3929,7 +3874,7 @@ def __init__(self, *, scheduled_date_time: Optional[datetime.datetime] = None, * class Resource(_serialization.Model): """Model of the Resource. - All required parameters must be populated in order to send to Azure. + 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 @@ -3940,9 +3885,9 @@ class Resource(_serialization.Model): viewing and grouping this resource (across resource groups). :vartype tags: dict[str, str] :ivar sku: The sku type. Required. - :vartype sku: ~azure.mgmt.databox.v2022_12_01.models.Sku + :vartype sku: ~azure.mgmt.databox.models.Sku :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2022_12_01.models.ResourceIdentity + :vartype identity: ~azure.mgmt.databox.models.ResourceIdentity """ _validation = { @@ -3976,9 +3921,9 @@ def __init__( 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.v2022_12_01.models.Sku + :paramtype sku: ~azure.mgmt.databox.models.Sku :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2022_12_01.models.ResourceIdentity + :paramtype identity: ~azure.mgmt.databox.models.ResourceIdentity """ super().__init__(**kwargs) self.location = location @@ -3992,7 +3937,7 @@ class JobResource(Resource): # pylint: disable=too-many-instance-attributes Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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 @@ -4003,9 +3948,9 @@ class JobResource(Resource): # pylint: disable=too-many-instance-attributes viewing and grouping this resource (across resource groups). :vartype tags: dict[str, str] :ivar sku: The sku type. Required. - :vartype sku: ~azure.mgmt.databox.v2022_12_01.models.Sku + :vartype sku: ~azure.mgmt.databox.models.Sku :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2022_12_01.models.ResourceIdentity + :vartype identity: ~azure.mgmt.databox.models.ResourceIdentity :ivar name: Name of the object. :vartype name: str :ivar id: Id of the object. @@ -4013,10 +3958,10 @@ class JobResource(Resource): # pylint: disable=too-many-instance-attributes :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.v2022_12_01.models.SystemData + :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.v2022_12_01.models.TransferType + :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. @@ -4026,11 +3971,11 @@ class JobResource(Resource): # pylint: disable=too-many-instance-attributes :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.v2022_12_01.models.ReverseShippingDetailsEditStatus + ~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.v2022_12_01.models.ReverseTransportPreferenceEditStatus + ~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", @@ -4039,19 +3984,19 @@ class JobResource(Resource): # pylint: disable=too-many-instance-attributes "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", and "ShippedToCustomer". - :vartype status: str or ~azure.mgmt.databox.v2022_12_01.models.StageName + :vartype status: str or ~azure.mgmt.databox.models.StageName :ivar start_time: Time at which the job was started in UTC ISO 8601 format. :vartype start_time: ~datetime.datetime :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.JobDetails + :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.v2022_12_01.models.JobDeliveryType + :vartype delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.v2022_12_01.models.JobDeliveryInfo + :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 """ @@ -4126,18 +4071,18 @@ def __init__( 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.v2022_12_01.models.Sku + :paramtype sku: ~azure.mgmt.databox.models.Sku :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2022_12_01.models.ResourceIdentity + :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.v2022_12_01.models.TransferType + :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.v2022_12_01.models.JobDetails + :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.v2022_12_01.models.JobDeliveryType + :paramtype delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.v2022_12_01.models.JobDeliveryInfo + :paramtype delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo """ super().__init__(location=location, tags=tags, sku=sku, identity=identity, **kwargs) self.name = None @@ -4165,7 +4110,7 @@ class JobResourceList(_serialization.Model): """Job Resource Collection. :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :vartype value: list[~azure.mgmt.databox.models.JobResource] :ivar next_link: Link for the next set of job resources. :vartype next_link: str """ @@ -4180,7 +4125,7 @@ def __init__( ) -> None: """ :keyword value: List of job resources. - :paramtype value: list[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :paramtype value: list[~azure.mgmt.databox.models.JobResource] :keyword next_link: Link for the next set of job resources. :paramtype next_link: str """ @@ -4196,9 +4141,9 @@ class JobResourceUpdateParameter(_serialization.Model): 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.v2022_12_01.models.ResourceIdentity + :vartype identity: ~azure.mgmt.databox.models.ResourceIdentity :ivar details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2022_12_01.models.UpdateJobDetails + :vartype details: ~azure.mgmt.databox.models.UpdateJobDetails """ _attribute_map = { @@ -4220,9 +4165,9 @@ def __init__( 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.v2022_12_01.models.ResourceIdentity + :paramtype identity: ~azure.mgmt.databox.models.ResourceIdentity :keyword details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2022_12_01.models.UpdateJobDetails + :paramtype details: ~azure.mgmt.databox.models.UpdateJobDetails """ super().__init__(**kwargs) self.tags = tags @@ -4241,7 +4186,7 @@ class JobStages(_serialization.Model): "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", and "ShippedToCustomer". - :vartype stage_name: str or ~azure.mgmt.databox.v2022_12_01.models.StageName + :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", @@ -4249,7 +4194,7 @@ class JobStages(_serialization.Model): "WaitingForCustomerAction", "SucceededWithWarnings", "WaitingForCustomerActionForKek", "WaitingForCustomerActionForCleanUp", "CustomerActionPerformedForCleanUp", and "CustomerActionPerformed". - :vartype stage_status: str or ~azure.mgmt.databox.v2022_12_01.models.StageStatus + :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. @@ -4285,13 +4230,13 @@ def __init__(self, **kwargs: Any) -> 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 Azure. + 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.v2022_12_01.models.KekType + :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.v2022_12_01.models.IdentityProperties + :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 @@ -4322,9 +4267,9 @@ def __init__( """ :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.v2022_12_01.models.KekType + :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.v2022_12_01.models.IdentityProperties + :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 @@ -4348,8 +4293,7 @@ class LastMitigationActionOnJob(_serialization.Model): :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.v2022_12_01.models.CustomerResolutionCode + :vartype customer_resolution: str or ~azure.mgmt.databox.models.CustomerResolutionCode """ _attribute_map = { @@ -4374,8 +4318,7 @@ def __init__( :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.v2022_12_01.models.CustomerResolutionCode + :paramtype customer_resolution: str or ~azure.mgmt.databox.models.CustomerResolutionCode """ super().__init__(**kwargs) self.action_date_time_in_utc = action_date_time_in_utc @@ -4386,11 +4329,11 @@ def __init__( class ManagedDiskDetails(DataAccountDetails): """Details of the managed disks. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.DataAccountType + :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 @@ -4449,11 +4392,10 @@ def __init__( 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 Azure. + 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.v2022_12_01.models.PackageCarrierInfo + :vartype deliver_to_dc_package_details: ~azure.mgmt.databox.models.PackageCarrierInfo """ _validation = { @@ -4467,8 +4409,7 @@ class MarkDevicesShippedRequest(_serialization.Model): 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.v2022_12_01.models.PackageCarrierInfo + :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 @@ -4479,12 +4420,11 @@ class MitigateJobRequest(_serialization.Model): :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.v2022_12_01.models.CustomerResolutionCode + :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.v2022_12_01.models.CustomerResolutionCode] + ~azure.mgmt.databox.models.CustomerResolutionCode] """ _attribute_map = { @@ -4502,12 +4442,11 @@ def __init__( """ :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.v2022_12_01.models.CustomerResolutionCode + :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.v2022_12_01.models.CustomerResolutionCode] + ~azure.mgmt.databox.models.CustomerResolutionCode] """ super().__init__(**kwargs) self.customer_resolution_code = customer_resolution_code @@ -4517,12 +4456,12 @@ def __init__( class NotificationPreference(_serialization.Model): """Notification preference for a job stage. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.NotificationStageName + :vartype stage_name: str or ~azure.mgmt.databox.models.NotificationStageName :ivar send_notification: Notification is required or not. :vartype send_notification: bool """ @@ -4544,7 +4483,7 @@ def __init__( :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.v2022_12_01.models.NotificationStageName + :paramtype stage_name: str or ~azure.mgmt.databox.models.NotificationStageName :keyword send_notification: Notification is required or not. :paramtype send_notification: bool """ @@ -4562,7 +4501,7 @@ class Operation(_serialization.Model): {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.v2022_12_01.models.OperationDisplay + :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. @@ -4651,7 +4590,7 @@ class OperationList(_serialization.Model): 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.v2022_12_01.models.Operation] + :vartype value: list[~azure.mgmt.databox.models.Operation] :ivar next_link: Link for the next set of operations. :vartype next_link: str """ @@ -4779,13 +4718,12 @@ class Preferences(_serialization.Model): :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.v2022_12_01.models.TransportPreferences + :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.v2022_12_01.models.TransportPreferences + :vartype reverse_transport_preferences: ~azure.mgmt.databox.models.TransportPreferences :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: ~azure.mgmt.databox.v2022_12_01.models.EncryptionPreferences + :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] @@ -4813,13 +4751,12 @@ def __init__( :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.v2022_12_01.models.TransportPreferences + :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.v2022_12_01.models.TransportPreferences + :paramtype reverse_transport_preferences: ~azure.mgmt.databox.models.TransportPreferences :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: ~azure.mgmt.databox.v2022_12_01.models.EncryptionPreferences + :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] @@ -4835,18 +4772,17 @@ def __init__( class PreferencesValidationRequest(ValidationInputRequest): """Request to validate preference of transport and data center. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator :ivar preference: Preference of transport and data center. - :vartype preference: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :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.v2022_12_01.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.models.SkuName """ _validation = { @@ -4869,10 +4805,10 @@ def __init__( ) -> None: """ :keyword preference: Preference of transport and data center. - :paramtype preference: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :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.v2022_12_01.models.SkuName + :paramtype device_type: str or ~azure.mgmt.databox.models.SkuName """ super().__init__(**kwargs) self.validation_type: str = "ValidatePreferences" @@ -4885,18 +4821,17 @@ class PreferencesValidationResponseProperties(ValidationInputResponse): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus """ _validation = { @@ -4923,15 +4858,13 @@ class RegionConfigurationRequest(_serialization.Model): :ivar schedule_availability_request: Request body to get the availability for scheduling orders. - :vartype schedule_availability_request: - ~azure.mgmt.databox.v2022_12_01.models.ScheduleAvailabilityRequest + :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.v2022_12_01.models.TransportAvailabilityRequest + ~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.v2022_12_01.models.DatacenterAddressRequest + :vartype datacenter_address_request: ~azure.mgmt.databox.models.DatacenterAddressRequest """ _attribute_map = { @@ -4955,14 +4888,13 @@ def __init__( :keyword schedule_availability_request: Request body to get the availability for scheduling orders. :paramtype schedule_availability_request: - ~azure.mgmt.databox.v2022_12_01.models.ScheduleAvailabilityRequest + ~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.v2022_12_01.models.TransportAvailabilityRequest + ~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.v2022_12_01.models.DatacenterAddressRequest + :paramtype datacenter_address_request: ~azure.mgmt.databox.models.DatacenterAddressRequest """ super().__init__(**kwargs) self.schedule_availability_request = schedule_availability_request @@ -4977,13 +4909,12 @@ class RegionConfigurationResponse(_serialization.Model): :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.v2022_12_01.models.ScheduleAvailabilityResponse + ~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.v2022_12_01.models.TransportAvailabilityResponse + ~azure.mgmt.databox.models.TransportAvailabilityResponse :ivar datacenter_address_response: Datacenter address for given sku in a region. - :vartype datacenter_address_response: - ~azure.mgmt.databox.v2022_12_01.models.DatacenterAddressResponse + :vartype datacenter_address_response: ~azure.mgmt.databox.models.DatacenterAddressResponse """ _validation = { @@ -5024,8 +4955,7 @@ class ResourceIdentity(_serialization.Model): :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.v2022_12_01.models.UserAssignedIdentity] + :vartype user_assigned_identities: dict[str, ~azure.mgmt.databox.models.UserAssignedIdentity] """ _validation = { @@ -5051,8 +4981,7 @@ def __init__( :keyword type: Identity type. :paramtype type: str :keyword user_assigned_identities: User Assigned Identities. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.databox.v2022_12_01.models.UserAssignedIdentity] + :paramtype user_assigned_identities: dict[str, ~azure.mgmt.databox.models.UserAssignedIdentity] """ super().__init__(**kwargs) self.type = type @@ -5067,9 +4996,9 @@ class ReverseShippingDetails(_serialization.Model): 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.v2022_12_01.models.ContactInfo + :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.v2022_12_01.models.ShippingAddress + :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. @@ -5095,9 +5024,9 @@ def __init__( ) -> None: """ :keyword contact_details: Contact Info. - :paramtype contact_details: ~azure.mgmt.databox.v2022_12_01.models.ContactInfo + :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.v2022_12_01.models.ShippingAddress + :paramtype shipping_address: ~azure.mgmt.databox.models.ShippingAddress """ super().__init__(**kwargs) self.contact_details = contact_details @@ -5137,14 +5066,13 @@ class ShareCredentialDetails(_serialization.Model): :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.v2022_12_01.models.ShareDestinationFormatType + :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.v2022_12_01.models.AccessProtocol] + :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] """ _validation = { @@ -5176,7 +5104,7 @@ def __init__(self, **kwargs: Any) -> None: class ShipmentPickUpRequest(_serialization.Model): """Shipment pick up request details. - All required parameters must be populated in order to send to Azure. + 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. @@ -5251,7 +5179,7 @@ def __init__(self, **kwargs: Any) -> None: class ShippingAddress(_serialization.Model): # pylint: disable=too-many-instance-attributes """Shipping address where customer wishes to receive the device. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar street_address1: Street Address line 1. Required. :vartype street_address1: str @@ -5272,7 +5200,7 @@ class ShippingAddress(_serialization.Model): # pylint: disable=too-many-instanc :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.v2022_12_01.models.AddressType + :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 @@ -5338,7 +5266,7 @@ def __init__( :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.v2022_12_01.models.AddressType + :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 @@ -5363,11 +5291,11 @@ def __init__( class Sku(_serialization.Model): """The Sku. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.SkuName + :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. @@ -5395,7 +5323,7 @@ def __init__( """ :keyword name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype name: str or ~azure.mgmt.databox.v2022_12_01.models.SkuName + :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. @@ -5410,19 +5338,18 @@ def __init__( class SkuAvailabilityValidationRequest(ValidationInputRequest): """Request to validate sku availability. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :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.v2022_12_01.models.SkuName + :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.v2022_12_01.models.TransferType + :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 @@ -5460,10 +5387,10 @@ def __init__( """ :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.v2022_12_01.models.SkuName + :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.v2022_12_01.models.TransferType + :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 @@ -5480,23 +5407,22 @@ def __init__( self.location = location -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): +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 Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus """ _validation = { @@ -5587,21 +5513,21 @@ class SkuInformation(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.v2022_12_01.models.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.v2022_12_01.models.DataLocationToServiceLocationMap] + list[~azure.mgmt.databox.models.DataLocationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2022_12_01.models.SkuCapacity + :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2022_12_01.models.SkuCost] + :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.v2022_12_01.models.SkuDisabledReason + :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. @@ -5658,11 +5584,11 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccountDetails(DataAccountDetails): """Details for the storage account. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.DataAccountType + :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 @@ -5702,16 +5628,15 @@ def __init__(self, *, storage_account_id: str, share_password: Optional[str] = N self.storage_account_id = storage_account_id -class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): +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 Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator """ _validation = { @@ -5728,23 +5653,24 @@ def __init__(self, **kwargs: Any) -> None: self.validation_type: str = "ValidateSubscriptionIsAllowedToCreateJob" -class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): +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 Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :vartype validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_12_01.models.CloudError + :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.v2022_12_01.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus """ _validation = { @@ -5819,11 +5745,11 @@ def __init__(self, **kwargs: Any) -> None: class TransferAllDetails(_serialization.Model): """Details to transfer all data. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.DataAccountType + :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. @@ -5851,7 +5777,7 @@ def __init__( """ :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.v2022_12_01.models.DataAccountType + :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. @@ -5866,20 +5792,20 @@ def __init__( class TransferConfiguration(_serialization.Model): """Configuration for defining the transfer of data. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.TransferConfigurationType + ~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.v2022_12_01.models.TransferConfigurationTransferFilterDetails + ~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.v2022_12_01.models.TransferConfigurationTransferAllDetails + ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails """ _validation = { @@ -5907,15 +5833,15 @@ def __init__( :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.v2022_12_01.models.TransferConfigurationType + ~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.v2022_12_01.models.TransferConfigurationTransferFilterDetails + ~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.v2022_12_01.models.TransferConfigurationTransferAllDetails + ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails """ super().__init__(**kwargs) self.transfer_configuration_type = transfer_configuration_type @@ -5928,7 +5854,7 @@ class TransferConfigurationTransferAllDetails(_serialization.Model): TransferConfigurationType is given as TransferAll. :ivar include: Details to transfer all data. - :vartype include: ~azure.mgmt.databox.v2022_12_01.models.TransferAllDetails + :vartype include: ~azure.mgmt.databox.models.TransferAllDetails """ _attribute_map = { @@ -5938,18 +5864,18 @@ class TransferConfigurationTransferAllDetails(_serialization.Model): def __init__(self, *, include: Optional["_models.TransferAllDetails"] = None, **kwargs: Any) -> None: """ :keyword include: Details to transfer all data. - :paramtype include: ~azure.mgmt.databox.v2022_12_01.models.TransferAllDetails + :paramtype include: ~azure.mgmt.databox.models.TransferAllDetails """ super().__init__(**kwargs) self.include = include -class TransferConfigurationTransferFilterDetails(_serialization.Model): +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.v2022_12_01.models.TransferFilterDetails + :vartype include: ~azure.mgmt.databox.models.TransferFilterDetails """ _attribute_map = { @@ -5959,7 +5885,7 @@ class TransferConfigurationTransferFilterDetails(_serialization.Model): 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.v2022_12_01.models.TransferFilterDetails + :paramtype include: ~azure.mgmt.databox.models.TransferFilterDetails """ super().__init__(**kwargs) self.include = include @@ -5968,18 +5894,17 @@ def __init__(self, *, include: Optional["_models.TransferFilterDetails"] = None, class TransferFilterDetails(_serialization.Model): """Details of the filtering the transfer of data. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.DataAccountType + :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.v2022_12_01.models.BlobFilterDetails + :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.v2022_12_01.models.AzureFileFilterDetails + :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.v2022_12_01.models.FilterFileDetails] + :vartype filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] """ _validation = { @@ -6005,14 +5930,13 @@ def __init__( """ :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.v2022_12_01.models.DataAccountType + :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.v2022_12_01.models.BlobFilterDetails + :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.v2022_12_01.models.AzureFileFilterDetails + :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.v2022_12_01.models.FilterFileDetails] + :paramtype filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] """ super().__init__(**kwargs) self.data_account_type = data_account_type @@ -6028,7 +5952,7 @@ class TransportAvailabilityDetails(_serialization.Model): :ivar shipment_type: Transport Shipment Type supported for given region. Known values are: "CustomerManaged" and "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.v2022_12_01.models.TransportShipmentTypes + :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes """ _validation = { @@ -6050,7 +5974,7 @@ class TransportAvailabilityRequest(_serialization.Model): :ivar sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype sku_name: str or ~azure.mgmt.databox.v2022_12_01.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.models.SkuName """ _attribute_map = { @@ -6061,7 +5985,7 @@ def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = None, """ :keyword sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype sku_name: str or ~azure.mgmt.databox.v2022_12_01.models.SkuName + :paramtype sku_name: str or ~azure.mgmt.databox.models.SkuName """ super().__init__(**kwargs) self.sku_name = sku_name @@ -6074,7 +5998,7 @@ class TransportAvailabilityResponse(_serialization.Model): :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.v2022_12_01.models.TransportAvailabilityDetails] + list[~azure.mgmt.databox.models.TransportAvailabilityDetails] """ _validation = { @@ -6099,12 +6023,11 @@ class TransportPreferences(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2022_12_01.models.TransportShipmentTypes + :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 @@ -6124,8 +6047,7 @@ def __init__(self, *, preferred_shipment_type: Union[str, "_models.TransportShip """ :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.v2022_12_01.models.TransportShipmentTypes + :paramtype preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes """ super().__init__(**kwargs) self.preferred_shipment_type = preferred_shipment_type @@ -6140,7 +6062,7 @@ class UnencryptedCredentials(_serialization.Model): :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.v2022_12_01.models.JobSecrets + :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets """ _validation = { @@ -6164,7 +6086,7 @@ class UnencryptedCredentialsList(_serialization.Model): """List of unencrypted credentials for accessing device. :ivar value: List of unencrypted credentials. - :vartype value: list[~azure.mgmt.databox.v2022_12_01.models.UnencryptedCredentials] + :vartype value: list[~azure.mgmt.databox.models.UnencryptedCredentials] :ivar next_link: Link for the next set of unencrypted credentials. :vartype next_link: str """ @@ -6183,7 +6105,7 @@ def __init__( ) -> None: """ :keyword value: List of unencrypted credentials. - :paramtype value: list[~azure.mgmt.databox.v2022_12_01.models.UnencryptedCredentials] + :paramtype value: list[~azure.mgmt.databox.models.UnencryptedCredentials] :keyword next_link: Link for the next set of unencrypted credentials. :paramtype next_link: str """ @@ -6196,19 +6118,17 @@ class UpdateJobDetails(_serialization.Model): """Job details for update. :ivar contact_details: Contact details for notification and shipping. - :vartype contact_details: ~azure.mgmt.databox.v2022_12_01.models.ContactDetails + :vartype contact_details: ~azure.mgmt.databox.models.ContactDetails :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :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.v2022_12_01.models.ReverseShippingDetails + :vartype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails :ivar preferences: Preferences related to the order. - :vartype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :vartype preferences: ~azure.mgmt.databox.models.Preferences :ivar key_encryption_key: Key encryption key for the job. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_12_01.models.KeyEncryptionKey + :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.v2022_12_01.models.PackageCarrierDetails + :vartype return_to_customer_package_details: ~azure.mgmt.databox.models.PackageCarrierDetails """ _attribute_map = { @@ -6236,19 +6156,17 @@ def __init__( ) -> None: """ :keyword contact_details: Contact details for notification and shipping. - :paramtype contact_details: ~azure.mgmt.databox.v2022_12_01.models.ContactDetails + :paramtype contact_details: ~azure.mgmt.databox.models.ContactDetails :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :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.v2022_12_01.models.ReverseShippingDetails + :paramtype reverse_shipping_details: ~azure.mgmt.databox.models.ReverseShippingDetails :keyword preferences: Preferences related to the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_12_01.models.Preferences + :paramtype preferences: ~azure.mgmt.databox.models.Preferences :keyword key_encryption_key: Key encryption key for the job. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_12_01.models.KeyEncryptionKey + :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.v2022_12_01.models.PackageCarrierDetails + :paramtype return_to_customer_package_details: ~azure.mgmt.databox.models.PackageCarrierDetails """ super().__init__(**kwargs) self.contact_details = contact_details @@ -6310,20 +6228,19 @@ def __init__(self, *, resource_id: Optional[str] = None, **kwargs: Any) -> None: 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 Azure. + 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.v2022_12_01.models.ValidationInputDiscriminator + :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.v2022_12_01.models.ShippingAddress + :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.v2022_12_01.models.SkuName + :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.v2022_12_01.models.TransportPreferences + :vartype transport_preferences: ~azure.mgmt.databox.models.TransportPreferences """ _validation = { @@ -6349,12 +6266,12 @@ def __init__( ) -> None: """ :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_12_01.models.ShippingAddress + :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.v2022_12_01.models.SkuName + :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.v2022_12_01.models.TransportPreferences + :paramtype transport_preferences: ~azure.mgmt.databox.models.TransportPreferences """ super().__init__(**kwargs) self.validation_type: str = "ValidateAddress" @@ -6370,11 +6287,10 @@ class ValidationResponse(_serialization.Model): :ivar status: Overall validation status. Known values are: "AllValidToProceed", "InputsRevisitRequired", and "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.v2022_12_01.models.OverallValidationStatus + :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.v2022_12_01.models.ValidationInputResponse] + :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] """ _validation = { diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_patch.py similarity index 100% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_patch.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models/_patch.py diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/__init__.py similarity index 100% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/__init__.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/__init__.py diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_data_box_management_client_operations.py similarity index 80% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_data_box_management_client_operations.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_data_box_management_client_operations.py index bcbc02eab000..8dfa7e7a6afe 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_data_box_management_client_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_data_box_management_client_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -17,16 +19,19 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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, _convert_request, _format_url_section +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 # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +58,7 @@ def build_mitigate_request(job_name: str, resource_group_name: str, subscription "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -67,6 +72,7 @@ def build_mitigate_request(job_name: str, resource_group_name: str, subscription class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC): + @overload def mitigate( # pylint: disable=inconsistent-return-statements self, @@ -86,11 +92,10 @@ def mitigate( # pylint: disable=inconsistent-return-statements :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.v2022_12_01.models.MitigateJobRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -101,7 +106,7 @@ def mitigate( # pylint: disable=inconsistent-return-statements self, job_name: str, resource_group_name: str, - mitigate_job_request: IO, + mitigate_job_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -115,11 +120,10 @@ def mitigate( # pylint: disable=inconsistent-return-statements :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 + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -130,7 +134,7 @@ def mitigate( # pylint: disable=inconsistent-return-statements self, job_name: str, resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], + mitigate_job_request: Union[_models.MitigateJobRequest, IO[bytes]], **kwargs: Any ) -> None: """Request to mitigate for a given job. @@ -141,18 +145,14 @@ def mitigate( # pylint: disable=inconsistent-return-statements :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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2022_12_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,19 +163,19 @@ def mitigate( # pylint: disable=inconsistent-return-statements _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", "2022-12-01")) + 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, (IO, bytes)): + if isinstance(mitigate_job_request, (IOBase, bytes)): _content = mitigate_job_request else: _json = self._serialize.body(mitigate_job_request, "MitigateJobRequest") - request = build_mitigate_request( + _request = build_mitigate_request( job_name=job_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -183,16 +183,14 @@ def mitigate( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self.mitigate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,8 +201,4 @@ def mitigate( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_jobs_operations.py similarity index 76% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_jobs_operations.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_jobs_operations.py index 3300801ba281..8d0f50677ed0 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_jobs_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_jobs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -15,22 +17,26 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +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 .._vendor import DataBoxManagementClientMixinABC, _convert_request, _format_url_section +from .._serialization import Serializer +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +57,7 @@ def build_list_request(subscription_id: str, *, skip_token: Optional[str] = None "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,7 +91,7 @@ def build_mark_devices_shipped_request( "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -117,7 +123,7 @@ def build_list_by_resource_group_request( "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -150,7 +156,7 @@ def build_get_request( "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -182,7 +188,7 @@ def build_create_request(resource_group_name: str, job_name: str, subscription_i "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -213,7 +219,7 @@ def build_delete_request(resource_group_name: str, job_name: str, subscription_i "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -245,7 +251,7 @@ def build_update_request( "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -281,7 +287,7 @@ def build_book_shipment_pick_up_request( "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -313,7 +319,7 @@ def build_cancel_request(resource_group_name: str, job_name: str, subscription_i "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -346,7 +352,7 @@ def build_list_credentials_request( "jobName": _SERIALIZER.url("job_name", job_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -363,7 +369,7 @@ class JobsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2022_12_01.DataBoxManagementClient`'s + :class:`~azure.mgmt.databox.DataBoxManagementClient`'s :attr:`jobs` attribute. """ @@ -383,18 +389,17 @@ def list(self, skip_token: Optional[str] = None, **kwargs: Any) -> Iterable["_mo :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :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", "2022-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -405,16 +410,14 @@ def list(self, skip_token: Optional[str] = None, **kwargs: Any) -> Iterable["_mo def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, skip_token=skip_token, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -426,13 +429,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("JobResourceList", pipeline_response) @@ -442,11 +444,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -459,8 +461,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - @overload def mark_devices_shipped( # pylint: disable=inconsistent-return-statements self, @@ -480,12 +480,10 @@ def mark_devices_shipped( # pylint: disable=inconsistent-return-statements :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.v2022_12_01.models.MarkDevicesShippedRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -496,7 +494,7 @@ def mark_devices_shipped( # pylint: disable=inconsistent-return-statements self, job_name: str, resource_group_name: str, - mark_devices_shipped_request: IO, + mark_devices_shipped_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -510,11 +508,10 @@ def mark_devices_shipped( # pylint: disable=inconsistent-return-statements :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 + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -525,7 +522,7 @@ 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], + mark_devices_shipped_request: Union[_models.MarkDevicesShippedRequest, IO[bytes]], **kwargs: Any ) -> None: """Request to mark devices for a given job as shipped. @@ -537,18 +534,14 @@ def mark_devices_shipped( # pylint: disable=inconsistent-return-statements :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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2022_12_01.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -559,19 +552,19 @@ def mark_devices_shipped( # pylint: disable=inconsistent-return-statements _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", "2022-12-01")) + 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, (IO, bytes)): + 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( + _request = build_mark_devices_shipped_request( job_name=job_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -579,16 +572,14 @@ def mark_devices_shipped( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self.mark_devices_shipped.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,11 +590,7 @@ def mark_devices_shipped( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def list_by_resource_group( @@ -616,18 +603,17 @@ def list_by_resource_group( :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :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", "2022-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -638,17 +624,15 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - request = build_list_by_resource_group_request( + _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, - template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -660,13 +644,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("JobResourceList", pipeline_response) @@ -676,11 +659,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -693,10 +676,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - @distributed_trace def get( self, resource_group_name: str, job_name: str, expand: Optional[str] = None, **kwargs: Any @@ -712,12 +691,11 @@ def get( :param expand: $expand is supported on details parameter for job, which provides details on the job stages. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.JobResource + :rtype: ~azure.mgmt.databox.models.JobResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,25 +706,23 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + 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( + _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, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -756,21 +732,21 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("JobResource", pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return deserialized # type: ignore def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { + self, + resource_group_name: str, + job_name: str, + job_resource: Union[_models.JobResource, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -781,19 +757,19 @@ def _create_initial( _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", "2022-12-01")) + 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[Optional[_models.JobResource]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(job_resource, (IO, bytes)): + if isinstance(job_resource, (IOBase, bytes)): _content = job_resource else: _json = self._serialize.body(job_resource, "JobResource") - request = build_create_request( + _request = build_create_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, @@ -801,37 +777,34 @@ def _create_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return deserialized # type: ignore @overload def begin_create( @@ -853,21 +826,13 @@ def begin_create( Required. :type job_name: str :param job_resource: Job details from request body. Required. - :type job_resource: ~azure.mgmt.databox.v2022_12_01.models.JobResource + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -876,7 +841,7 @@ def begin_create( self, resource_group_name: str, job_name: str, - job_resource: IO, + job_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -891,27 +856,23 @@ def begin_create( Required. :type job_name: str :param job_resource: Job details from request body. Required. - :type job_resource: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :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], **kwargs: Any + 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. @@ -922,29 +883,18 @@ def begin_create( 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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2022_12_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + :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.v2022_12_01.models.JobResource] + :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", "2022-12-01")) + 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) @@ -962,12 +912,13 @@ def begin_create( 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) + deserialized = self._deserialize("JobResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -977,22 +928,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return LROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { + def _delete_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1003,29 +950,32 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) - cls: ClsType[None] = kwargs.pop("cls", None) + 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( + _request = build_delete_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _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) @@ -1034,12 +984,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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, None, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return deserialized # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1051,14 +1001,6 @@ def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) - must be between 3 and 24 characters in length and use any alphanumeric and underscore only. Required. :type job_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -1066,13 +1008,13 @@ def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + 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( # type: ignore + raw_result = self._delete_initial( resource_group_name=resource_group_name, job_name=job_name, api_version=api_version, @@ -1081,11 +1023,12 @@ def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) - 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, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1094,27 +1037,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + 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], + job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1125,19 +1064,19 @@ def _update_initial( _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", "2022-12-01")) + 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[Optional[_models.JobResource]] = kwargs.pop("cls", 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, (IO, bytes)): + 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( + _request = build_update_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, @@ -1146,41 +1085,38 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - if response.status_code == 202: response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - if cls: - return cls(pipeline_response, deserialized, response_headers) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - return deserialized + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return deserialized # type: ignore @overload def begin_update( @@ -1202,25 +1138,16 @@ def begin_update( 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.v2022_12_01.models.JobResourceUpdateParameter + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1229,7 +1156,7 @@ def begin_update( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: IO, + job_resource_update_parameter: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", @@ -1244,24 +1171,16 @@ def begin_update( Required. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. Required. - :type job_resource_update_parameter: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1270,7 +1189,7 @@ def begin_update( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], + job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> LROPoller[_models.JobResource]: @@ -1283,32 +1202,21 @@ def begin_update( Required. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. Is either a - JobResourceUpdateParameter type or a IO type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2022_12_01.models.JobResourceUpdateParameter or IO + 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 - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_12_01.models.JobResource] + :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", "2022-12-01")) + 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) @@ -1327,12 +1235,13 @@ def begin_update( 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) + deserialized = self._deserialize("JobResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1342,17 +1251,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } + return LROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def book_shipment_pick_up( @@ -1373,13 +1280,12 @@ def book_shipment_pick_up( 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.v2022_12_01.models.ShipmentPickUpRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1388,7 +1294,7 @@ def book_shipment_pick_up( self, resource_group_name: str, job_name: str, - shipment_pick_up_request: IO, + shipment_pick_up_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1402,13 +1308,12 @@ def book_shipment_pick_up( Required. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. Required. - :type shipment_pick_up_request: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1417,7 +1322,7 @@ def book_shipment_pick_up( self, resource_group_name: str, job_name: str, - shipment_pick_up_request: Union[_models.ShipmentPickUpRequest, IO], + shipment_pick_up_request: Union[_models.ShipmentPickUpRequest, IO[bytes]], **kwargs: Any ) -> _models.ShipmentPickUpResponse: """Book shipment pick up. @@ -1429,18 +1334,13 @@ def book_shipment_pick_up( Required. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. Is either a - ShipmentPickUpRequest type or a IO type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2022_12_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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.v2022_12_01.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1451,19 +1351,19 @@ def book_shipment_pick_up( _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", "2022-12-01")) + 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, (IO, bytes)): + 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( + _request = build_book_shipment_pick_up_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, @@ -1471,16 +1371,14 @@ def book_shipment_pick_up( content_type=content_type, json=_json, content=_content, - template_url=self.book_shipment_pick_up.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1490,16 +1388,12 @@ def book_shipment_pick_up( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response) + deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } + return deserialized # type: ignore @overload def cancel( # pylint: disable=inconsistent-return-statements @@ -1520,11 +1414,10 @@ def cancel( # pylint: disable=inconsistent-return-statements Required. :type job_name: str :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2022_12_01.models.CancellationReason + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1535,7 +1428,7 @@ def cancel( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, job_name: str, - cancellation_reason: IO, + cancellation_reason: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1549,11 +1442,10 @@ def cancel( # pylint: disable=inconsistent-return-statements Required. :type job_name: str :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1564,7 +1456,7 @@ def cancel( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], + cancellation_reason: Union[_models.CancellationReason, IO[bytes]], **kwargs: Any ) -> None: """CancelJob. @@ -1576,17 +1468,13 @@ def cancel( # pylint: disable=inconsistent-return-statements Required. :type job_name: str :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2022_12_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1597,19 +1485,19 @@ def cancel( # pylint: disable=inconsistent-return-statements _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", "2022-12-01")) + 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, (IO, bytes)): + if isinstance(cancellation_reason, (IOBase, bytes)): _content = cancellation_reason else: _json = self._serialize.body(cancellation_reason, "CancellationReason") - request = build_cancel_request( + _request = build_cancel_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, @@ -1617,16 +1505,14 @@ def cancel( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self.cancel.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1637,11 +1523,7 @@ def cancel( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def list_credentials( @@ -1655,20 +1537,18 @@ def list_credentials( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. Required. :type job_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either UnencryptedCredentials or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_12_01.models.UnencryptedCredentials] + :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", "2022-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1679,17 +1559,15 @@ def list_credentials( def prepare_request(next_link=None): if not next_link: - request = build_list_credentials_request( + _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, - template_url=self.list_credentials.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1701,13 +1579,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) @@ -1717,11 +1594,11 @@ def extract_data(pipeline_response): return None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1733,7 +1610,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_operations.py similarity index 82% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_operations.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_operations.py index cbe9a98b454d..119d5b5ef343 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -19,16 +20,18 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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 _convert_request +from .._serialization import Serializer +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +43,7 @@ def build_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", "2020-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +64,7 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2020_11_01.DataBoxManagementClient`'s + :class:`~azure.mgmt.databox.DataBoxManagementClient`'s :attr:`operations` attribute. """ @@ -78,18 +81,17 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: """This method gets all the operations. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.models.Operation] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.Operation] :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", "2020-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -100,14 +102,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -119,13 +119,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("OperationList", pipeline_response) @@ -135,11 +134,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,5 +150,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_patch.py similarity index 100% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_patch.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_patch.py diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_service_operations.py similarity index 76% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_service_operations.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_service_operations.py index a50ea56fee4d..039b6d40b17d 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_service_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/operations/_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -19,16 +21,18 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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, _convert_request, _format_url_section +from .._serialization import Serializer +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -57,7 +61,7 @@ def build_list_available_skus_by_resource_group_request( # pylint: disable=name "location": _SERIALIZER.url("location", location, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,7 +92,7 @@ def build_validate_address_request(location: str, subscription_id: str, **kwargs "location": _SERIALIZER.url("location", location, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -122,7 +126,7 @@ def build_validate_inputs_by_resource_group_request( # pylint: disable=name-too "location": _SERIALIZER.url("location", location, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -153,7 +157,7 @@ def build_validate_inputs_request(location: str, subscription_id: str, **kwargs: "location": _SERIALIZER.url("location", location, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -184,7 +188,7 @@ def build_region_configuration_request(location: str, subscription_id: str, **kw "location": _SERIALIZER.url("location", location, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -218,7 +222,7 @@ def build_region_configuration_by_resource_group_request( # pylint: disable=nam "location": _SERIALIZER.url("location", location, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -237,7 +241,7 @@ class ServiceOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2022_12_01.DataBoxManagementClient`'s + :class:`~azure.mgmt.databox.DataBoxManagementClient`'s :attr:`service` attribute. """ @@ -268,13 +272,12 @@ def list_available_skus_by_resource_group( :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.v2022_12_01.models.AvailableSkuRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_12_01.models.SkuInformation] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -283,7 +286,7 @@ def list_available_skus_by_resource_group( self, resource_group_name: str, location: str, - available_sku_request: IO, + available_sku_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -296,13 +299,12 @@ def list_available_skus_by_resource_group( :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 + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_12_01.models.SkuInformation] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -311,7 +313,7 @@ def list_available_skus_by_resource_group( self, resource_group_name: str, location: str, - available_sku_request: Union[_models.AvailableSkuRequest, IO], + 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 @@ -322,24 +324,20 @@ def list_available_skus_by_resource_group( :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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2022_12_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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.v2022_12_01.models.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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +347,7 @@ def list_available_skus_by_resource_group( content_type = content_type or "application/json" _json = None _content = None - if isinstance(available_sku_request, (IO, bytes)): + if isinstance(available_sku_request, (IOBase, bytes)): _content = available_sku_request else: _json = self._serialize.body(available_sku_request, "AvailableSkuRequest") @@ -357,7 +355,7 @@ def list_available_skus_by_resource_group( def prepare_request(next_link=None): if not next_link: - request = build_list_available_skus_by_resource_group_request( + _request = build_list_available_skus_by_resource_group_request( resource_group_name=resource_group_name, location=location, subscription_id=self._config.subscription_id, @@ -365,12 +363,10 @@ def prepare_request(next_link=None): content_type=content_type, json=_json, content=_content, - template_url=self.list_available_skus_by_resource_group.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -382,13 +378,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableSkusResult", pipeline_response) @@ -398,11 +393,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -415,10 +410,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - @overload def validate_address( self, @@ -434,19 +425,18 @@ def validate_address( :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.v2022_12_01.models.ValidateAddress + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput :raises ~azure.core.exceptions.HttpResponseError: """ @overload def validate_address( - self, location: str, validate_address: IO, *, content_type: str = "application/json", **kwargs: Any + 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. @@ -454,19 +444,18 @@ def validate_address( :param location: The location of the resource. Required. :type location: str :param validate_address: Shipping address of the customer. Required. - :type validate_address: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.AddressValidationOutput + :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], **kwargs: Any + 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. @@ -474,17 +463,13 @@ def validate_address( :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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2022_12_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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.v2022_12_01.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.models.AddressValidationOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -495,35 +480,33 @@ def validate_address( _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", "2022-12-01")) + 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, (IO, bytes)): + if isinstance(validate_address, (IOBase, bytes)): _content = validate_address else: _json = self._serialize.body(validate_address, "ValidateAddress") - request = build_validate_address_request( + _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, - template_url=self.validate_address.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -533,16 +516,12 @@ def validate_address( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AddressValidationOutput", pipeline_response) + deserialized = self._deserialize("AddressValidationOutput", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } + return deserialized # type: ignore @overload def validate_inputs_by_resource_group( @@ -561,13 +540,12 @@ def validate_inputs_by_resource_group( :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.v2022_12_01.models.ValidationRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse + :rtype: ~azure.mgmt.databox.models.ValidationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -576,7 +554,7 @@ def validate_inputs_by_resource_group( self, resource_group_name: str, location: str, - validation_request: IO, + validation_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -588,13 +566,12 @@ def validate_inputs_by_resource_group( :param location: The location of the resource. Required. :type location: str :param validation_request: Inputs of the customer. Required. - :type validation_request: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse + :rtype: ~azure.mgmt.databox.models.ValidationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -603,7 +580,7 @@ def validate_inputs_by_resource_group( self, resource_group_name: str, location: str, - validation_request: Union[_models.ValidationRequest, IO], + validation_request: Union[_models.ValidationRequest, IO[bytes]], **kwargs: Any ) -> _models.ValidationResponse: """This method does all necessary pre-job creation validation under resource group. @@ -612,18 +589,14 @@ def validate_inputs_by_resource_group( :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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_12_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :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.v2022_12_01.models.ValidationResponse + :rtype: ~azure.mgmt.databox.models.ValidationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,19 +607,19 @@ def validate_inputs_by_resource_group( _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", "2022-12-01")) + 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, (IO, bytes)): + 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( + _request = build_validate_inputs_by_resource_group_request( resource_group_name=resource_group_name, location=location, subscription_id=self._config.subscription_id, @@ -654,16 +627,14 @@ def validate_inputs_by_resource_group( content_type=content_type, json=_json, content=_content, - template_url=self.validate_inputs_by_resource_group.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -673,16 +644,12 @@ def validate_inputs_by_resource_group( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("ValidationResponse", pipeline_response) + deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } + return deserialized # type: ignore @overload def validate_inputs( @@ -698,55 +665,49 @@ def validate_inputs( :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.v2022_12_01.models.ValidationRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse + :rtype: ~azure.mgmt.databox.models.ValidationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def validate_inputs( - self, location: str, validation_request: IO, *, content_type: str = "application/json", **kwargs: Any + 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 + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse + :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], **kwargs: Any + 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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_12_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :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.v2022_12_01.models.ValidationResponse + :rtype: ~azure.mgmt.databox.models.ValidationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -757,35 +718,33 @@ def validate_inputs( _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", "2022-12-01")) + 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, (IO, bytes)): + if isinstance(validation_request, (IOBase, bytes)): _content = validation_request else: _json = self._serialize.body(validation_request, "ValidationRequest") - request = build_validate_inputs_request( + _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, - template_url=self.validate_inputs.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -795,16 +754,12 @@ def validate_inputs( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("ValidationResponse", pipeline_response) + deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } + return deserialized # type: ignore @overload def region_configuration( @@ -822,20 +777,23 @@ def region_configuration( :type location: str :param region_configuration_request: Request body to get the configuration for the region. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def region_configuration( - self, location: str, region_configuration_request: IO, *, content_type: str = "application/json", **kwargs: Any + 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. @@ -844,19 +802,21 @@ def region_configuration( :type location: str :param region_configuration_request: Request body to get the configuration for the region. Required. - :type region_configuration_request: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse + :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], **kwargs: Any + 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. @@ -864,18 +824,14 @@ def region_configuration( :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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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.v2022_12_01.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,35 +842,33 @@ def region_configuration( _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", "2022-12-01")) + 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, (IO, bytes)): + 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( + _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, - template_url=self.region_configuration.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -924,16 +878,12 @@ def region_configuration( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response) + deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } + return deserialized # type: ignore @overload def region_configuration_by_resource_group( @@ -954,14 +904,12 @@ def region_configuration_by_resource_group( :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.v2022_12_01.models.RegionConfigurationRequest + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -970,7 +918,7 @@ def region_configuration_by_resource_group( self, resource_group_name: str, location: str, - region_configuration_request: IO, + region_configuration_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -984,13 +932,12 @@ def region_configuration_by_resource_group( :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 + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -999,7 +946,7 @@ def region_configuration_by_resource_group( self, resource_group_name: str, location: str, - region_configuration_request: Union[_models.RegionConfigurationRequest, IO], + 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 @@ -1010,18 +957,15 @@ def region_configuration_by_resource_group( :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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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.v2022_12_01.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1032,19 +976,19 @@ def region_configuration_by_resource_group( _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", "2022-12-01")) + 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, (IO, bytes)): + 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( + _request = build_region_configuration_by_resource_group_request( resource_group_name=resource_group_name, location=location, subscription_id=self._config.subscription_id, @@ -1052,16 +996,14 @@ def region_configuration_by_resource_group( content_type=content_type, json=_json, content=_content, - template_url=self.region_configuration_by_resource_group.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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 + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1071,13 +1013,9 @@ def region_configuration_by_resource_group( error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response) + deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } + return deserialized # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_configuration.py deleted file mode 100644 index d488ff11c446..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2018-01-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2018-01-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_data_box_management_client.py deleted file mode 100644 index ed1e190b9410..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_data_box_management_client.py +++ /dev/null @@ -1,97 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2018_01_01.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2018_01_01.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2018_01_01.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2018-01-01". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_metadata.json deleted file mode 100644 index eb7779da40b9..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_metadata.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "chosen_version": "2018-01-01", - "total_api_version_list": ["2018-01-01"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_vendor.py deleted file mode 100644 index bd0df84f5319..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_vendor.py +++ /dev/null @@ -1,30 +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 typing import List, cast - -from azure.core.pipeline.transport import HttpRequest - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_configuration.py deleted file mode 100644 index ffd8fd32466e..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2018-01-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2018-01-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_data_box_management_client.py deleted file mode 100644 index 27aa34f1eed3..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_data_box_management_client.py +++ /dev/null @@ -1,97 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2018_01_01.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2018_01_01.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2018_01_01.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2018-01-01". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/__init__.py deleted file mode 100644 index 351b58b163ad..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/__init__.py +++ /dev/null @@ -1,23 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_jobs_operations.py deleted file mode 100644 index 10b7ebc0d07a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1269 +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 typing import Any, AsyncIterable, 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, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import 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 ..._vendor import _convert_request -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_update_request, -) - -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.v2018_01_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2018-01-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2018-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2018_01_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2018_01_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2018_01_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2018_01_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2018-01-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2018-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2018_01_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2018_01_01.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, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2018_01_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2018_01_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2018_01_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2018_01_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2018-01-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - 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.v2018_01_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2018_01_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2018-01-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_operations.py deleted file mode 100644 index 81f998c57982..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_operations.py +++ /dev/null @@ -1,133 +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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -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 ..._vendor import _convert_request -from ...operations._operations import build_list_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2018_01_01.aio.DataBoxManagementClient`'s - :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") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.Operation] - :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", "2018-01-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_service_operations.py deleted file mode 100644 index 8f22e7c3c5f3..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_service_operations.py +++ /dev/null @@ -1,325 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -from ...operations._service_operations import build_list_available_skus_request, build_validate_address_request - -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.v2018_01_01.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( - self, - 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 and location. - - :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.v2018_01_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_available_skus( - self, location: str, available_sku_request: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription and location. - - :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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_available_skus( - self, location: str, available_sku_request: Union[_models.AvailableSkuRequest, IO], **kwargs: Any - ) -> AsyncIterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription and location. - - :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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2018_01_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_available_skus.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_available_skus.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @overload - async def validate_address( - self, - location: str, - validate_address: _models.ValidateAddress, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AddressValidationOutput: - """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.v2018_01_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AddressValidationOutput: - """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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **kwargs: Any - ) -> _models.AddressValidationOutput: - """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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2018_01_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2018-01-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AddressValidationOutput", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/__init__.py deleted file mode 100644 index 75f6aa57c979..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/__init__.py +++ /dev/null @@ -1,149 +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 ._models_py3 import AccountCredentialDetails -from ._models_py3 import AddressValidationOutput -from ._models_py3 import ApplianceNetworkConfiguration -from ._models_py3 import ArmBaseObject -from ._models_py3 import AvailableSkuRequest -from ._models_py3 import AvailableSkusResult -from ._models_py3 import CancellationReason -from ._models_py3 import ContactDetails -from ._models_py3 import CopyLogDetails -from ._models_py3 import CopyProgress -from ._models_py3 import DataBoxAccountCopyLogDetails -from ._models_py3 import DataBoxDiskCopyLogDetails -from ._models_py3 import DataBoxDiskCopyProgress -from ._models_py3 import DataBoxDiskJobDetails -from ._models_py3 import DataBoxDiskJobSecrets -from ._models_py3 import DataBoxHeavyAccountCopyLogDetails -from ._models_py3 import DataBoxHeavyJobDetails -from ._models_py3 import DataBoxHeavyJobSecrets -from ._models_py3 import DataBoxHeavySecret -from ._models_py3 import DataBoxJobDetails -from ._models_py3 import DataBoxSecret -from ._models_py3 import DataboxJobSecrets -from ._models_py3 import DestinationAccountDetails -from ._models_py3 import DestinationManagedDiskDetails -from ._models_py3 import DestinationStorageAccountDetails -from ._models_py3 import DestinationToServiceLocationMap -from ._models_py3 import DiskSecret -from ._models_py3 import Error -from ._models_py3 import JobDetails -from ._models_py3 import JobErrorDetails -from ._models_py3 import JobResource -from ._models_py3 import JobResourceList -from ._models_py3 import JobResourceUpdateParameter -from ._models_py3 import JobSecrets -from ._models_py3 import JobStages -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import PackageShippingDetails -from ._models_py3 import Preferences -from ._models_py3 import Resource -from ._models_py3 import ShareCredentialDetails -from ._models_py3 import ShipmentPickUpRequest -from ._models_py3 import ShipmentPickUpResponse -from ._models_py3 import ShippingAddress -from ._models_py3 import Sku -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuInformation -from ._models_py3 import UnencryptedCredentials -from ._models_py3 import UnencryptedCredentialsList -from ._models_py3 import UpdateJobDetails -from ._models_py3 import ValidateAddress - -from ._data_box_management_client_enums import AccessProtocol -from ._data_box_management_client_enums import AddressType -from ._data_box_management_client_enums import AddressValidationStatus -from ._data_box_management_client_enums import ClassDiscriminator -from ._data_box_management_client_enums import CopyStatus -from ._data_box_management_client_enums import DataDestinationType -from ._data_box_management_client_enums import NotificationStageName -from ._data_box_management_client_enums import ShareDestinationFormatType -from ._data_box_management_client_enums import SkuDisabledReason -from ._data_box_management_client_enums import SkuName -from ._data_box_management_client_enums import StageName -from ._data_box_management_client_enums import StageStatus -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccountCredentialDetails", - "AddressValidationOutput", - "ApplianceNetworkConfiguration", - "ArmBaseObject", - "AvailableSkuRequest", - "AvailableSkusResult", - "CancellationReason", - "ContactDetails", - "CopyLogDetails", - "CopyProgress", - "DataBoxAccountCopyLogDetails", - "DataBoxDiskCopyLogDetails", - "DataBoxDiskCopyProgress", - "DataBoxDiskJobDetails", - "DataBoxDiskJobSecrets", - "DataBoxHeavyAccountCopyLogDetails", - "DataBoxHeavyJobDetails", - "DataBoxHeavyJobSecrets", - "DataBoxHeavySecret", - "DataBoxJobDetails", - "DataBoxSecret", - "DataboxJobSecrets", - "DestinationAccountDetails", - "DestinationManagedDiskDetails", - "DestinationStorageAccountDetails", - "DestinationToServiceLocationMap", - "DiskSecret", - "Error", - "JobDetails", - "JobErrorDetails", - "JobResource", - "JobResourceList", - "JobResourceUpdateParameter", - "JobSecrets", - "JobStages", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationList", - "PackageShippingDetails", - "Preferences", - "Resource", - "ShareCredentialDetails", - "ShipmentPickUpRequest", - "ShipmentPickUpResponse", - "ShippingAddress", - "Sku", - "SkuCapacity", - "SkuCost", - "SkuInformation", - "UnencryptedCredentials", - "UnencryptedCredentialsList", - "UpdateJobDetails", - "ValidateAddress", - "AccessProtocol", - "AddressType", - "AddressValidationStatus", - "ClassDiscriminator", - "CopyStatus", - "DataDestinationType", - "NotificationStageName", - "ShareDestinationFormatType", - "SkuDisabledReason", - "SkuName", - "StageName", - "StageStatus", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_data_box_management_client_enums.py deleted file mode 100644 index ed3a036ea8af..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_data_box_management_client_enums.py +++ /dev/null @@ -1,193 +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 enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" - - SMB = "SMB" - """Server Message Block protocol(SMB).""" - NFS = "NFS" - """Network File System protocol(NFS).""" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The address validation status.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the type of job details.""" - - DATA_BOX = "DataBox" - """DataBox orders.""" - DATA_BOX_DISK = "DataBoxDisk" - """DataBoxDisk orders.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """DataBoxHeavy orders.""" - - -class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Status of the copy.""" - - NOT_STARTED = "NotStarted" - """Data copy hasn't started yet.""" - IN_PROGRESS = "InProgress" - """Data copy is in progress.""" - COMPLETED = "Completed" - """Data copy completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Data copy completed with errors.""" - FAILED = "Failed" - """Data copy failed. No data was copied.""" - NOT_RETURNED = "NotReturned" - """No copy triggered as device was not returned.""" - - -class DataDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data Destination Type.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown type.""" - STORAGE_ACCOUNT = "StorageAccount" - """Storage Accounts .""" - MANAGED_DISK = "ManagedDisk" - """Azure Managed disk storage.""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - DEVICE_PREPARED = "DevicePrepared" - """Notification at device prepared stage.""" - DISPATCHED = "Dispatched" - """Notification at device dispatched stage.""" - DELIVERED = "Delivered" - """Notification at device delivered stage.""" - PICKED_UP = "PickedUp" - """Notification at device picked up from user stage.""" - AT_AZURE_DC = "AtAzureDC" - """Notification at device received at azure datacenter stage.""" - DATA_COPY = "DataCopy" - """Notification at data copy started stage.""" - - -class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the share.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown format.""" - HCS = "HCS" - """StorSimple data format.""" - BLOCK_BLOB = "BlockBlob" - """Azure storage block blob format.""" - PAGE_BLOB = "PageBlob" - """Azure storage page blob format.""" - AZURE_FILE = "AzureFile" - """Azure storage file format.""" - MANAGED_DISK = "ManagedDisk" - """Azure Compute Disk.""" - - -class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the Sku is disabled.""" - - NONE = "None" - """SKU is not disabled.""" - COUNTRY = "Country" - """SKU is not available in the requested country.""" - REGION = "Region" - """SKU is not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled for the SKU.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types for the SKU.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" - - DATA_BOX = "DataBox" - """DataBox.""" - DATA_BOX_DISK = "DataBoxDisk" - """DataBoxDisk.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """DataBoxHeavy.""" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage which is in progress.""" - - DEVICE_ORDERED = "DeviceOrdered" - """An order has been created.""" - DEVICE_PREPARED = "DevicePrepared" - """A device has been prepared for the order.""" - DISPATCHED = "Dispatched" - """Device has been dispatched to the user of the order.""" - DELIVERED = "Delivered" - """Device has been delivered to the user of the order.""" - PICKED_UP = "PickedUp" - """Device has been picked up from user and in transit to azure datacenter.""" - AT_AZURE_DC = "AtAzureDC" - """Device has been received at azure datacenter from the user.""" - DATA_COPY = "DataCopy" - """Data copy from the device at azure datacenter.""" - COMPLETED = "Completed" - """Order has completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Order has completed with errors.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" - """Order has failed due to issue reported by user.""" - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" - """Order has failed due to issue detected at azure datacenter.""" - ABORTED = "Aborted" - """Order has been aborted.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the job stage.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" - """Stage has succeeded with errors.""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models_py3.py deleted file mode 100644 index 1bf153e83a85..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models_py3.py +++ /dev/null @@ -1,2534 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union - -from ... import _serialization - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models - - -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 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.v2018_01_01.models.ShareCredentialDetails] - """ - - _validation = { - "account_name": {"readonly": True}, - "account_connection_string": {"readonly": True}, - "share_credential_details": {"readonly": True}, - } - - _attribute_map = { - "account_name": {"key": "accountName", "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.account_connection_string = None - self.share_credential_details = None - - -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_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2018_01_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2018_01_01.models.ShippingAddress] - """ - - _validation = { - "validation_status": {"readonly": True}, - "alternate_addresses": {"readonly": True}, - } - - _attribute_map = { - "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_status = None - self.alternate_addresses = None - - -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. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar transfer_type: Type of the transfer. Required. Default value is "ImportToAzure". - :vartype transfer_type: str - :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.v2018_01_01.models.SkuName] - """ - - _validation = { - "transfer_type": {"required": True, "constant": 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]"}, - } - - transfer_type = "ImportToAzure" - - def __init__( - self, - *, - country: str, - location: str, - sku_names: Optional[List[Union[str, "_models.SkuName"]]] = None, - **kwargs: Any - ) -> None: - """ - :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.v2018_01_01.models.SkuName] - """ - super().__init__(**kwargs) - 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.v2018_01_01.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 CancellationReason(_serialization.Model): - """Reason for cancellation. - - All required parameters must be populated in order to send to Azure. - - :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 ContactDetails(_serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :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.v2018_01_01.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.v2018_01_01.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 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, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails - - All required parameters must be populated in order to send to Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2018_01_01.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", - "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 where the data needs to be uploaded. - :vartype storage_account_name: str - :ivar account_id: Id of the account where the data needs to be uploaded. - :vartype account_id: str - :ivar bytes_sent_to_cloud: Amount of data uploaded by the job as of now. - :vartype bytes_sent_to_cloud: 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 by the job as of now. - :vartype files_processed: int - :ivar total_files_to_process: Total number of files to be processed by the job. - :vartype total_files_to_process: int - """ - - _validation = { - "storage_account_name": {"readonly": True}, - "account_id": {"readonly": True}, - "bytes_sent_to_cloud": {"readonly": True}, - "total_bytes_to_process": {"readonly": True}, - "files_processed": {"readonly": True}, - "total_files_to_process": {"readonly": True}, - } - - _attribute_map = { - "storage_account_name": {"key": "storageAccountName", "type": "str"}, - "account_id": {"key": "accountId", "type": "str"}, - "bytes_sent_to_cloud": {"key": "bytesSentToCloud", "type": "int"}, - "total_bytes_to_process": {"key": "totalBytesToProcess", "type": "int"}, - "files_processed": {"key": "filesProcessed", "type": "int"}, - "total_files_to_process": {"key": "totalFilesToProcess", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.storage_account_name = None - self.account_id = None - self.bytes_sent_to_cloud = None - self.total_bytes_to_process = None - self.files_processed = None - self.total_files_to_process = None - - -class DataBoxAccountCopyLogDetails(CopyLogDetails): - """Copy log details for a storage account of a DataBox job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator - :ivar account_name: Destination account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: str - """ - - _validation = { - "copy_log_details_type": {"required": True}, - "account_name": {"readonly": True}, - "copy_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"}, - } - - 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 - - -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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2018_01_01.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", and "NotReturned". - :vartype status: str or ~azure.mgmt.databox.v2018_01_01.models.CopyStatus - """ - - _validation = { - "serial_number": {"readonly": True}, - "bytes_copied": {"readonly": True}, - "percent_complete": {"readonly": True}, - "status": {"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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Job details. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DataBoxJobDetails, 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 Azure. - - :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 job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2018_01_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails - :ivar destination_account_details: Destination account details. Required. - :vartype destination_account_details: - list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.v2018_01_01.models.JobErrorDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2018_01_01.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 - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "shipping_address": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"readonly": True}, - "destination_account_details": {"required": True}, - "error_details": {"readonly": True}, - "job_details_type": {"required": True}, - "copy_log_details": {"readonly": True}, - "reverse_shipment_label_sas_key": {"readonly": True}, - "chain_of_custody_sas_key": {"readonly": True}, - } - - _attribute_map = { - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "job_stages": {"key": "jobStages", "type": "[JobStages]"}, - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "delivery_package": {"key": "deliveryPackage", "type": "PackageShippingDetails"}, - "return_package": {"key": "returnPackage", "type": "PackageShippingDetails"}, - "destination_account_details": {"key": "destinationAccountDetails", "type": "[DestinationAccountDetails]"}, - "error_details": {"key": "errorDetails", "type": "[JobErrorDetails]"}, - "job_details_type": {"key": "jobDetailsType", "type": "str"}, - "preferences": {"key": "preferences", "type": "Preferences"}, - "copy_log_details": {"key": "copyLogDetails", "type": "[CopyLogDetails]"}, - "reverse_shipment_label_sas_key": {"key": "reverseShipmentLabelSasKey", "type": "str"}, - "chain_of_custody_sas_key": {"key": "chainOfCustodySasKey", "type": "str"}, - } - - _subtype_map = { - "job_details_type": { - "DataBox": "DataBoxJobDetails", - "DataBoxDisk": "DataBoxDiskJobDetails", - "DataBoxHeavy": "DataBoxHeavyJobDetails", - } - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: "_models.ShippingAddress", - destination_account_details: List["_models.DestinationAccountDetails"], - expected_data_size_in_tera_bytes: Optional[int] = None, - preferences: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :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 contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - :keyword destination_account_details: Destination account details. Required. - :paramtype destination_account_details: - list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences - """ - super().__init__(**kwargs) - self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes - self.job_stages = None - self.contact_details = contact_details - self.shipping_address = shipping_address - self.delivery_package = None - self.return_package = None - self.destination_account_details = destination_account_details - self.error_details = None - self.job_details_type: Optional[str] = None - self.preferences = preferences - self.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = None - - -class DataBoxDiskJobDetails(JobDetails): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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 job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2018_01_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails - :ivar destination_account_details: Destination account details. Required. - :vartype destination_account_details: - list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.v2018_01_01.models.JobErrorDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2018_01_01.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 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.v2018_01_01.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :ivar passkey: User entered passkey for DataBox Disk job. - :vartype passkey: str - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "shipping_address": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"readonly": True}, - "destination_account_details": {"required": True}, - "error_details": {"readonly": True}, - "job_details_type": {"required": True}, - "copy_log_details": {"readonly": True}, - "reverse_shipment_label_sas_key": {"readonly": True}, - "chain_of_custody_sas_key": {"readonly": True}, - "copy_progress": {"readonly": True}, - "disks_and_size_details": {"readonly": True}, - } - - _attribute_map = { - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "job_stages": {"key": "jobStages", "type": "[JobStages]"}, - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "delivery_package": {"key": "deliveryPackage", "type": "PackageShippingDetails"}, - "return_package": {"key": "returnPackage", "type": "PackageShippingDetails"}, - "destination_account_details": {"key": "destinationAccountDetails", "type": "[DestinationAccountDetails]"}, - "error_details": {"key": "errorDetails", "type": "[JobErrorDetails]"}, - "job_details_type": {"key": "jobDetailsType", "type": "str"}, - "preferences": {"key": "preferences", "type": "Preferences"}, - "copy_log_details": {"key": "copyLogDetails", "type": "[CopyLogDetails]"}, - "reverse_shipment_label_sas_key": {"key": "reverseShipmentLabelSasKey", "type": "str"}, - "chain_of_custody_sas_key": {"key": "chainOfCustodySasKey", "type": "str"}, - "preferred_disks": {"key": "preferredDisks", "type": "{int}"}, - "copy_progress": {"key": "copyProgress", "type": "[DataBoxDiskCopyProgress]"}, - "disks_and_size_details": {"key": "disksAndSizeDetails", "type": "{int}"}, - "passkey": {"key": "passkey", "type": "str"}, - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: "_models.ShippingAddress", - destination_account_details: List["_models.DestinationAccountDetails"], - expected_data_size_in_tera_bytes: Optional[int] = None, - preferences: Optional["_models.Preferences"] = None, - preferred_disks: Optional[Dict[str, int]] = None, - passkey: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :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 contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - :keyword destination_account_details: Destination account details. Required. - :paramtype destination_account_details: - list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences - :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__( - expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, - contact_details=contact_details, - shipping_address=shipping_address, - destination_account_details=destination_account_details, - preferences=preferences, - **kwargs - ) - self.job_details_type: str = "DataBoxDisk" - self.preferred_disks = preferred_disks - self.copy_progress = None - self.disks_and_size_details = None - self.passkey = passkey - - -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, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets - - All required parameters must be populated in order to send to Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator - """ - - _validation = { - "job_secrets_type": {"required": True}, - } - - _attribute_map = { - "job_secrets_type": {"key": "jobSecretsType", "type": "str"}, - } - - _subtype_map = { - "job_secrets_type": { - "DataBox": "DataboxJobSecrets", - "DataBoxDisk": "DataBoxDiskJobSecrets", - "DataBoxHeavy": "DataBoxHeavyJobSecrets", - } - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.job_secrets_type: Optional[str] = None - - -class DataBoxDiskJobSecrets(JobSecrets): - """The secrets related to disk job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2018_01_01.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}, - "disk_secrets": {"readonly": True}, - "pass_key": {"readonly": True}, - "is_passkey_user_defined": {"readonly": True}, - } - - _attribute_map = { - "job_secrets_type": {"key": "jobSecretsType", "type": "str"}, - "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 DataBoxHeavy. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator - :ivar account_name: Destination account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: list[str] - """ - - _validation = { - "copy_log_details_type": {"required": True}, - "account_name": {"readonly": True}, - "copy_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]"}, - } - - 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 - - -class DataBoxHeavyJobDetails(JobDetails): # pylint: disable=too-many-instance-attributes - """DataBoxHeavy 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 Azure. - - :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 job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2018_01_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails - :ivar destination_account_details: Destination account details. Required. - :vartype destination_account_details: - list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.v2018_01_01.models.JobErrorDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2018_01_01.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 copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.v2018_01_01.models.CopyProgress] - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "shipping_address": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"readonly": True}, - "destination_account_details": {"required": True}, - "error_details": {"readonly": True}, - "job_details_type": {"required": True}, - "copy_log_details": {"readonly": True}, - "reverse_shipment_label_sas_key": {"readonly": True}, - "chain_of_custody_sas_key": {"readonly": True}, - "copy_progress": {"readonly": True}, - } - - _attribute_map = { - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "job_stages": {"key": "jobStages", "type": "[JobStages]"}, - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "delivery_package": {"key": "deliveryPackage", "type": "PackageShippingDetails"}, - "return_package": {"key": "returnPackage", "type": "PackageShippingDetails"}, - "destination_account_details": {"key": "destinationAccountDetails", "type": "[DestinationAccountDetails]"}, - "error_details": {"key": "errorDetails", "type": "[JobErrorDetails]"}, - "job_details_type": {"key": "jobDetailsType", "type": "str"}, - "preferences": {"key": "preferences", "type": "Preferences"}, - "copy_log_details": {"key": "copyLogDetails", "type": "[CopyLogDetails]"}, - "reverse_shipment_label_sas_key": {"key": "reverseShipmentLabelSasKey", "type": "str"}, - "chain_of_custody_sas_key": {"key": "chainOfCustodySasKey", "type": "str"}, - "copy_progress": {"key": "copyProgress", "type": "[CopyProgress]"}, - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: "_models.ShippingAddress", - destination_account_details: List["_models.DestinationAccountDetails"], - expected_data_size_in_tera_bytes: Optional[int] = None, - preferences: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :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 contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - :keyword destination_account_details: Destination account details. Required. - :paramtype destination_account_details: - list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences - """ - super().__init__( - expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, - contact_details=contact_details, - shipping_address=shipping_address, - destination_account_details=destination_account_details, - preferences=preferences, - **kwargs - ) - self.job_details_type: str = "DataBoxHeavy" - self.copy_progress = None - - -class DataBoxHeavyJobSecrets(JobSecrets): - """The secrets related to a DataBoxHeavy job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator - :ivar cabinet_pod_secrets: Contains the list of secret objects for a DataBoxHeavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.v2018_01_01.models.DataBoxHeavySecret] - """ - - _validation = { - "job_secrets_type": {"required": True}, - "cabinet_pod_secrets": {"readonly": True}, - } - - _attribute_map = { - "job_secrets_type": {"key": "jobSecretsType", "type": "str"}, - "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 DataBoxHeavy. - - 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.v2018_01_01.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.v2018_01_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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 job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2018_01_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails - :ivar destination_account_details: Destination account details. Required. - :vartype destination_account_details: - list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.v2018_01_01.models.JobErrorDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2018_01_01.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 copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.v2018_01_01.models.CopyProgress] - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "shipping_address": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"readonly": True}, - "destination_account_details": {"required": True}, - "error_details": {"readonly": True}, - "job_details_type": {"required": True}, - "copy_log_details": {"readonly": True}, - "reverse_shipment_label_sas_key": {"readonly": True}, - "chain_of_custody_sas_key": {"readonly": True}, - "copy_progress": {"readonly": True}, - } - - _attribute_map = { - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "job_stages": {"key": "jobStages", "type": "[JobStages]"}, - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "delivery_package": {"key": "deliveryPackage", "type": "PackageShippingDetails"}, - "return_package": {"key": "returnPackage", "type": "PackageShippingDetails"}, - "destination_account_details": {"key": "destinationAccountDetails", "type": "[DestinationAccountDetails]"}, - "error_details": {"key": "errorDetails", "type": "[JobErrorDetails]"}, - "job_details_type": {"key": "jobDetailsType", "type": "str"}, - "preferences": {"key": "preferences", "type": "Preferences"}, - "copy_log_details": {"key": "copyLogDetails", "type": "[CopyLogDetails]"}, - "reverse_shipment_label_sas_key": {"key": "reverseShipmentLabelSasKey", "type": "str"}, - "chain_of_custody_sas_key": {"key": "chainOfCustodySasKey", "type": "str"}, - "copy_progress": {"key": "copyProgress", "type": "[CopyProgress]"}, - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: "_models.ShippingAddress", - destination_account_details: List["_models.DestinationAccountDetails"], - expected_data_size_in_tera_bytes: Optional[int] = None, - preferences: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :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 contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - :keyword destination_account_details: Destination account details. Required. - :paramtype destination_account_details: - list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences - """ - super().__init__( - expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, - contact_details=contact_details, - shipping_address=shipping_address, - destination_account_details=destination_account_details, - preferences=preferences, - **kwargs - ) - self.job_details_type: str = "DataBox" - self.copy_progress = None - - -class DataboxJobSecrets(JobSecrets): - """The secrets related to a DataBox job. - - All required parameters must be populated in order to send to Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.v2018_01_01.models.DataBoxSecret] - """ - - _validation = { - "job_secrets_type": {"required": True}, - } - - _attribute_map = { - "job_secrets_type": {"key": "jobSecretsType", "type": "str"}, - "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.v2018_01_01.models.DataBoxSecret] - """ - super().__init__(**kwargs) - self.job_secrets_type: str = "DataBox" - self.pod_secrets = pod_secrets - - -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.v2018_01_01.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.v2018_01_01.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 DestinationAccountDetails(_serialization.Model): - """Details of the destination of the data. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DestinationManagedDiskDetails, DestinationStorageAccountDetails - - All required parameters must be populated in order to send to Azure. - - :ivar data_destination_type: Data Destination Type. Required. Known values are: "UnknownType", - "StorageAccount", and "ManagedDisk". - :vartype data_destination_type: str or - ~azure.mgmt.databox.v2018_01_01.models.DataDestinationType - :ivar account_id: Arm Id of the destination where the data has to be moved. - :vartype account_id: str - """ - - _validation = { - "data_destination_type": {"required": True}, - } - - _attribute_map = { - "data_destination_type": {"key": "dataDestinationType", "type": "str"}, - "account_id": {"key": "accountId", "type": "str"}, - } - - _subtype_map = { - "data_destination_type": { - "ManagedDisk": "DestinationManagedDiskDetails", - "StorageAccount": "DestinationStorageAccountDetails", - } - } - - def __init__(self, *, account_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword account_id: Arm Id of the destination where the data has to be moved. - :paramtype account_id: str - """ - super().__init__(**kwargs) - self.data_destination_type: Optional[str] = None - self.account_id = account_id - - -class DestinationManagedDiskDetails(DestinationAccountDetails): - """Details for the destination compute disks. - - All required parameters must be populated in order to send to Azure. - - :ivar data_destination_type: Data Destination Type. Required. Known values are: "UnknownType", - "StorageAccount", and "ManagedDisk". - :vartype data_destination_type: str or - ~azure.mgmt.databox.v2018_01_01.models.DataDestinationType - :ivar account_id: Arm Id of the destination where the data has to be moved. - :vartype account_id: str - :ivar resource_group_id: Destination Resource Group Id where the Compute disks should be - created. Required. - :vartype resource_group_id: str - :ivar staging_storage_account_id: Arm Id of the storage account that can be used to copy the - vhd for staging. Required. - :vartype staging_storage_account_id: str - """ - - _validation = { - "data_destination_type": {"required": True}, - "resource_group_id": {"required": True}, - "staging_storage_account_id": {"required": True}, - } - - _attribute_map = { - "data_destination_type": {"key": "dataDestinationType", "type": "str"}, - "account_id": {"key": "accountId", "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, - account_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword account_id: Arm Id of the destination where the data has to be moved. - :paramtype account_id: str - :keyword resource_group_id: Destination Resource Group Id where the Compute disks should be - created. Required. - :paramtype resource_group_id: str - :keyword staging_storage_account_id: Arm Id of the storage account that can be used to copy the - vhd for staging. Required. - :paramtype staging_storage_account_id: str - """ - super().__init__(account_id=account_id, **kwargs) - self.data_destination_type: str = "ManagedDisk" - self.resource_group_id = resource_group_id - self.staging_storage_account_id = staging_storage_account_id - - -class DestinationStorageAccountDetails(DestinationAccountDetails): - """Details for the destination storage account. - - All required parameters must be populated in order to send to Azure. - - :ivar data_destination_type: Data Destination Type. Required. Known values are: "UnknownType", - "StorageAccount", and "ManagedDisk". - :vartype data_destination_type: str or - ~azure.mgmt.databox.v2018_01_01.models.DataDestinationType - :ivar account_id: Arm Id of the destination where the data has to be moved. - :vartype account_id: str - :ivar storage_account_id: Destination Storage Account Arm Id. Required. - :vartype storage_account_id: str - """ - - _validation = { - "data_destination_type": {"required": True}, - "storage_account_id": {"required": True}, - } - - _attribute_map = { - "data_destination_type": {"key": "dataDestinationType", "type": "str"}, - "account_id": {"key": "accountId", "type": "str"}, - "storage_account_id": {"key": "storageAccountId", "type": "str"}, - } - - def __init__(self, *, storage_account_id: str, account_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword account_id: Arm Id of the destination where the data has to be moved. - :paramtype account_id: str - :keyword storage_account_id: Destination Storage Account Arm Id. Required. - :paramtype storage_account_id: str - """ - super().__init__(account_id=account_id, **kwargs) - self.data_destination_type: str = "StorageAccount" - self.storage_account_id = storage_account_id - - -class DestinationToServiceLocationMap(_serialization.Model): - """Map of destination location to service location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar destination_location: Location of the destination. - :vartype destination_location: str - :ivar service_location: Location of the service. - :vartype service_location: str - """ - - _validation = { - "destination_location": {"readonly": True}, - "service_location": {"readonly": True}, - } - - _attribute_map = { - "destination_location": {"key": "destinationLocation", "type": "str"}, - "service_location": {"key": "serviceLocation", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.destination_location = None - self.service_location = None - - -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 Error(_serialization.Model): - """Top level error for the job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Error code that can be used to programmatically identify the error. - :vartype code: str - :ivar message: Describes the error in detail and provides debugging information. - :vartype message: str - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code = None - self.message = None - - -class JobErrorDetails(_serialization.Model): - """Job Error Details for providing the information and recommended action. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error_message: Message for the error. - :vartype error_message: str - :ivar error_code: Code for the error. - :vartype error_code: int - :ivar recommended_action: Recommended action for the error. - :vartype recommended_action: str - :ivar exception_message: Contains the non localized exception message. - :vartype exception_message: str - """ - - _validation = { - "error_message": {"readonly": True}, - "error_code": {"readonly": True}, - "recommended_action": {"readonly": True}, - "exception_message": {"readonly": True}, - } - - _attribute_map = { - "error_message": {"key": "errorMessage", "type": "str"}, - "error_code": {"key": "errorCode", "type": "int"}, - "recommended_action": {"key": "recommendedAction", "type": "str"}, - "exception_message": {"key": "exceptionMessage", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.error_message = None - self.error_code = None - self.recommended_action = None - self.exception_message = None - - -class Resource(_serialization.Model): - """Model of the Resource. - - All required parameters must be populated in order to send to Azure. - - :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.v2018_01_01.models.Sku - """ - - _validation = { - "location": {"required": True}, - "sku": {"required": True}, - } - - _attribute_map = { - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - } - - def __init__( - self, *, location: str, sku: "_models.Sku", tags: Optional[Dict[str, str]] = 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.v2018_01_01.models.Sku - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - - -class JobResource(Resource): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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.v2018_01_01.models.Sku - :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 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 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", and "Aborted". - :vartype status: str or ~azure.mgmt.databox.v2018_01_01.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.v2018_01_01.models.Error - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.v2018_01_01.models.JobDetails - :ivar cancellation_reason: Reason for cancellation. - :vartype cancellation_reason: str - """ - - _validation = { - "location": {"required": True}, - "sku": {"required": True}, - "name": {"readonly": True}, - "id": {"readonly": True}, - "type": {"readonly": True}, - "is_cancellable": {"readonly": True}, - "is_deletable": {"readonly": True}, - "is_shipping_address_editable": {"readonly": True}, - "status": {"readonly": True}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - } - - _attribute_map = { - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "name": {"key": "name", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "is_cancellable": {"key": "properties.isCancellable", "type": "bool"}, - "is_deletable": {"key": "properties.isDeletable", "type": "bool"}, - "is_shipping_address_editable": {"key": "properties.isShippingAddressEditable", "type": "bool"}, - "status": {"key": "properties.status", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "error": {"key": "properties.error", "type": "Error"}, - "details": {"key": "properties.details", "type": "JobDetails"}, - "cancellation_reason": {"key": "properties.cancellationReason", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - sku: "_models.Sku", - tags: Optional[Dict[str, str]] = None, - details: Optional["_models.JobDetails"] = 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.v2018_01_01.models.Sku - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.v2018_01_01.models.JobDetails - """ - super().__init__(location=location, tags=tags, sku=sku, **kwargs) - self.name = None - self.id = None - self.type = None - self.is_cancellable = None - self.is_deletable = None - self.is_shipping_address_editable = None - self.status = None - self.start_time = None - self.error = None - self.details = details - self.cancellation_reason = None - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2018_01_01.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.v2018_01_01.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 details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2018_01_01.models.UpdateJobDetails - :ivar destination_account_details: Destination account details. - :vartype destination_account_details: - list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "details": {"key": "properties.details", "type": "UpdateJobDetails"}, - "destination_account_details": { - "key": "properties.destinationAccountDetails", - "type": "[DestinationAccountDetails]", - }, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - details: Optional["_models.UpdateJobDetails"] = None, - destination_account_details: Optional[List["_models.DestinationAccountDetails"]] = 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 details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2018_01_01.models.UpdateJobDetails - :keyword destination_account_details: Destination account details. - :paramtype destination_account_details: - list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] - """ - super().__init__(**kwargs) - self.tags = tags - self.details = details - self.destination_account_details = destination_account_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", and "Aborted". - :vartype stage_name: str or ~azure.mgmt.databox.v2018_01_01.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", and "SucceededWithErrors". - :vartype stage_status: str or ~azure.mgmt.databox.v2018_01_01.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 error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.v2018_01_01.models.JobErrorDetails] - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"readonly": True}, - "error_details": {"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"}, - "error_details": {"key": "errorDetails", "type": "[JobErrorDetails]"}, - } - - 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.error_details = None - - -class NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :ivar stage_name: Name of the stage. Required. Known values are: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", and "DataCopy". - :vartype stage_name: str or ~azure.mgmt.databox.v2018_01_01.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", and "DataCopy". - :paramtype stage_name: str or ~azure.mgmt.databox.v2018_01_01.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.v2018_01_01.models.OperationDisplay - :ivar properties: Operation properties. - :vartype properties: JSON - :ivar origin: Origin of the operation. Can be : user|system|user,system. - :vartype origin: str - """ - - _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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.display = None - self.properties = None - self.origin = None - - -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.v2018_01_01.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 PackageShippingDetails(_serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar tracking_id: Tracking Id of shipment. - :vartype tracking_id: str - :ivar tracking_url: Url where shipment can be tracked. - :vartype tracking_url: str - """ - - _validation = { - "carrier_name": {"readonly": True}, - "tracking_id": {"readonly": True}, - "tracking_url": {"readonly": True}, - } - - _attribute_map = { - "carrier_name": {"key": "carrierName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - "tracking_url": {"key": "trackingUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = None - - -class Preferences(_serialization.Model): - """Preferences related to the order. - - :ivar preferred_data_center_region: - :vartype preferred_data_center_region: list[str] - """ - - _attribute_map = { - "preferred_data_center_region": {"key": "preferredDataCenterRegion", "type": "[str]"}, - } - - def __init__(self, *, preferred_data_center_region: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword preferred_data_center_region: - :paramtype preferred_data_center_region: list[str] - """ - super().__init__(**kwargs) - self.preferred_data_center_region = preferred_data_center_region - - -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.v2018_01_01.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.v2018_01_01.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 Azure. - - :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 Azure. - - :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. Required. - :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.v2018_01_01.models.AddressType - """ - - _validation = { - "street_address1": {"required": True}, - "country": {"required": True}, - "postal_code": {"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"}, - } - - def __init__( - self, - *, - street_address1: str, - country: str, - postal_code: str, - street_address2: Optional[str] = None, - street_address3: Optional[str] = None, - city: Optional[str] = None, - state_or_province: Optional[str] = None, - zip_extended_code: Optional[str] = None, - company_name: Optional[str] = None, - address_type: Union[str, "_models.AddressType"] = "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. Required. - :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.v2018_01_01.models.AddressType - """ - 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 - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :vartype name: str or ~azure.mgmt.databox.v2018_01_01.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype name: str or ~azure.mgmt.databox.v2018_01_01.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - - -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 - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = 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 - """ - - _validation = { - "meter_id": {"readonly": True}, - "meter_type": {"readonly": True}, - } - - _attribute_map = { - "meter_id": {"key": "meterId", "type": "str"}, - "meter_type": {"key": "meterType", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.meter_id = None - self.meter_type = 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.v2018_01_01.models.Sku - :ivar enabled: The sku is enabled or not. - :vartype enabled: bool - :ivar destination_to_service_location_map: The map of destination location to service location. - :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.v2018_01_01.models.DestinationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2018_01_01.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2018_01_01.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.v2018_01_01.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 - """ - - _validation = { - "sku": {"readonly": True}, - "enabled": {"readonly": True}, - "destination_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}, - } - - _attribute_map = { - "sku": {"key": "sku", "type": "Sku"}, - "enabled": {"key": "enabled", "type": "bool"}, - "destination_to_service_location_map": { - "key": "properties.destinationToServiceLocationMap", - "type": "[DestinationToServiceLocationMap]", - }, - "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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.sku = None - self.enabled = None - self.destination_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 - - -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.v2018_01_01.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.v2018_01_01.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.v2018_01_01.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.v2018_01_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - """ - - _attribute_map = { - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - } - - def __init__( - self, - *, - contact_details: Optional["_models.ContactDetails"] = None, - shipping_address: Optional["_models.ShippingAddress"] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. - :paramtype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - """ - super().__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address - - -class ValidateAddress(_serialization.Model): - """The requirements to validate customer address where the device needs to be shipped. - - All required parameters must be populated in order to send to Azure. - - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2018_01_01.models.SkuName - """ - - _validation = { - "shipping_address": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "device_type": {"key": "deviceType", "type": "str"}, - } - - def __init__( - self, *, shipping_address: "_models.ShippingAddress", device_type: Union[str, "_models.SkuName"], **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2018_01_01.models.SkuName - """ - super().__init__(**kwargs) - self.shipping_address = shipping_address - self.device_type = device_type diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/__init__.py deleted file mode 100644 index 351b58b163ad..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/__init__.py +++ /dev/null @@ -1,23 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_jobs_operations.py deleted file mode 100644 index efadbc3db7c6..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_jobs_operations.py +++ /dev/null @@ -1,1535 +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 typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, 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.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .._vendor import _convert_request, _format_url_section - -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", "2018-01-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 = _format_url_section(_url, **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_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", "2018-01-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 = _format_url_section(_url, **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", "2018-01-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 = _format_url_section(_url, **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", "2018-01-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 = _format_url_section(_url, **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: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) - # 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 = _format_url_section(_url, **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_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", "2018-01-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 = _format_url_section(_url, **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", "2018-01-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 = _format_url_section(_url, **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", "2018-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # 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 = _format_url_section(_url, **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_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", "2018-01-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 = _format_url_section(_url, **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.v2018_01_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2018-01-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2018-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2018_01_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2018_01_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2018_01_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2018_01_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2018-01-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2018-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2018_01_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2018_01_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2018_01_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2018_01_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2018_01_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2018_01_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2018-01-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - 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.v2018_01_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2018_01_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2018-01-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_operations.py deleted file mode 100644 index a16fe63d2dfc..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_operations.py +++ /dev/null @@ -1,154 +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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar -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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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 _convert_request - -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(**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", "2018-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2018_01_01.DataBoxManagementClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.Operation] - :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", "2018-01-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_service_operations.py deleted file mode 100644 index cf3b808cee12..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_service_operations.py +++ /dev/null @@ -1,385 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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 _convert_request, _format_url_section - -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_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", "2018-01-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}/availableSkus" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _format_url_section(_url, **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", "2018-01-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 = _format_url_section(_url, **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.v2018_01_01.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( - self, - 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 and location. - - :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.v2018_01_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_available_skus( - self, location: str, available_sku_request: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> Iterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription and location. - - :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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_available_skus( - self, location: str, available_sku_request: Union[_models.AvailableSkuRequest, IO], **kwargs: Any - ) -> Iterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription and location. - - :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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2018_01_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.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", "2018-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_available_skus.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_available_skus.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @overload - def validate_address( - self, - location: str, - validate_address: _models.ValidateAddress, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AddressValidationOutput: - """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.v2018_01_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AddressValidationOutput: - """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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **kwargs: Any - ) -> _models.AddressValidationOutput: - """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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2018_01_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2018-01-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AddressValidationOutput", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_configuration.py deleted file mode 100644 index e9b3c4145373..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2019-09-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2019-09-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_data_box_management_client.py deleted file mode 100644 index 64cbdaa4001f..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_data_box_management_client.py +++ /dev/null @@ -1,97 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2019_09_01.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2019_09_01.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2019_09_01.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2019-09-01". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_metadata.json deleted file mode 100644 index d42ce0b4da2b..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_metadata.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "chosen_version": "2019-09-01", - "total_api_version_list": ["2019-09-01"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_vendor.py deleted file mode 100644 index bd0df84f5319..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_vendor.py +++ /dev/null @@ -1,30 +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 typing import List, cast - -from azure.core.pipeline.transport import HttpRequest - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_configuration.py deleted file mode 100644 index 3fc641ba12ac..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2019-09-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2019-09-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_data_box_management_client.py deleted file mode 100644 index 6ecd302a97e3..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_data_box_management_client.py +++ /dev/null @@ -1,97 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2019_09_01.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2019_09_01.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2019_09_01.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2019-09-01". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/__init__.py deleted file mode 100644 index 351b58b163ad..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/__init__.py +++ /dev/null @@ -1,23 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_jobs_operations.py deleted file mode 100644 index 0f8581a0c298..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1269 +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 typing import Any, AsyncIterable, 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, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import 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 ..._vendor import _convert_request -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_update_request, -) - -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.v2019_09_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2019-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2019_09_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2019_09_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2019_09_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2019_09_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2019-09-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2019-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2019_09_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2019_09_01.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, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2019_09_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2019_09_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2019_09_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2019_09_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - 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.v2019_09_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2019_09_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_operations.py deleted file mode 100644 index d205d75717f7..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_operations.py +++ /dev/null @@ -1,133 +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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -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 ..._vendor import _convert_request -from ...operations._operations import build_list_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2019_09_01.aio.DataBoxManagementClient`'s - :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") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.Operation] - :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", "2019-09-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_service_operations.py deleted file mode 100644 index 3304f5c45bdd..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_service_operations.py +++ /dev/null @@ -1,891 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -from ...operations._service_operations import ( - build_list_available_skus_by_resource_group_request, - build_list_available_skus_request, - build_region_configuration_request, - build_validate_address_request, - build_validate_inputs_by_resource_group_request, - build_validate_inputs_request, -) - -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.v2019_09_01.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( - self, - 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 and location. - - :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.v2019_09_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_available_skus( - self, location: str, available_sku_request: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription and location. - - :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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_available_skus( - self, location: str, available_sku_request: Union[_models.AvailableSkuRequest, IO], **kwargs: Any - ) -> AsyncIterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription and location. - - :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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_available_skus.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_available_skus.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2019_09_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2019_09_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2019_09_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AddressValidationOutput", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2019_09_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ValidationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2019_09_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ValidationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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. - - :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.v2019_09_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration( - self, location: str, region_configuration_request: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location. - - :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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location. - - :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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/__init__.py deleted file mode 100644 index c4f57a659892..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/__init__.py +++ /dev/null @@ -1,219 +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 ._models_py3 import AccountCredentialDetails -from ._models_py3 import AddressValidationOutput -from ._models_py3 import AddressValidationProperties -from ._models_py3 import ApplianceNetworkConfiguration -from ._models_py3 import ArmBaseObject -from ._models_py3 import AvailableSkuRequest -from ._models_py3 import AvailableSkusResult -from ._models_py3 import CancellationReason -from ._models_py3 import CloudError -from ._models_py3 import ContactDetails -from ._models_py3 import CopyLogDetails -from ._models_py3 import CopyProgress -from ._models_py3 import CreateJobValidations -from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest -from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties -from ._models_py3 import DataBoxAccountCopyLogDetails -from ._models_py3 import DataBoxDiskCopyLogDetails -from ._models_py3 import DataBoxDiskCopyProgress -from ._models_py3 import DataBoxDiskJobDetails -from ._models_py3 import DataBoxDiskJobSecrets -from ._models_py3 import DataBoxHeavyAccountCopyLogDetails -from ._models_py3 import DataBoxHeavyJobDetails -from ._models_py3 import DataBoxHeavyJobSecrets -from ._models_py3 import DataBoxHeavySecret -from ._models_py3 import DataBoxJobDetails -from ._models_py3 import DataBoxScheduleAvailabilityRequest -from ._models_py3 import DataBoxSecret -from ._models_py3 import DataDestinationDetailsValidationRequest -from ._models_py3 import DataDestinationDetailsValidationResponseProperties -from ._models_py3 import DataboxJobSecrets -from ._models_py3 import DcAccessSecurityCode -from ._models_py3 import DestinationAccountDetails -from ._models_py3 import DestinationManagedDiskDetails -from ._models_py3 import DestinationStorageAccountDetails -from ._models_py3 import DestinationToServiceLocationMap -from ._models_py3 import DiskScheduleAvailabilityRequest -from ._models_py3 import DiskSecret -from ._models_py3 import Error -from ._models_py3 import HeavyScheduleAvailabilityRequest -from ._models_py3 import JobDeliveryInfo -from ._models_py3 import JobDetails -from ._models_py3 import JobErrorDetails -from ._models_py3 import JobResource -from ._models_py3 import JobResourceList -from ._models_py3 import JobResourceUpdateParameter -from ._models_py3 import JobSecrets -from ._models_py3 import JobStages -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import PackageShippingDetails -from ._models_py3 import Preferences -from ._models_py3 import PreferencesValidationRequest -from ._models_py3 import PreferencesValidationResponseProperties -from ._models_py3 import RegionConfigurationRequest -from ._models_py3 import RegionConfigurationResponse -from ._models_py3 import Resource -from ._models_py3 import ScheduleAvailabilityRequest -from ._models_py3 import ScheduleAvailabilityResponse -from ._models_py3 import ShareCredentialDetails -from ._models_py3 import ShipmentPickUpRequest -from ._models_py3 import ShipmentPickUpResponse -from ._models_py3 import ShippingAddress -from ._models_py3 import Sku -from ._models_py3 import SkuAvailabilityValidationRequest -from ._models_py3 import SkuAvailabilityValidationResponseProperties -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuInformation -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties -from ._models_py3 import TransportAvailabilityDetails -from ._models_py3 import TransportAvailabilityRequest -from ._models_py3 import TransportAvailabilityResponse -from ._models_py3 import TransportPreferences -from ._models_py3 import UnencryptedCredentials -from ._models_py3 import UnencryptedCredentialsList -from ._models_py3 import UpdateJobDetails -from ._models_py3 import ValidateAddress -from ._models_py3 import ValidationInputRequest -from ._models_py3 import ValidationInputResponse -from ._models_py3 import ValidationRequest -from ._models_py3 import ValidationResponse - -from ._data_box_management_client_enums import AccessProtocol -from ._data_box_management_client_enums import AddressType -from ._data_box_management_client_enums import AddressValidationStatus -from ._data_box_management_client_enums import ClassDiscriminator -from ._data_box_management_client_enums import CopyStatus -from ._data_box_management_client_enums import DataDestinationType -from ._data_box_management_client_enums import JobDeliveryType -from ._data_box_management_client_enums import NotificationStageName -from ._data_box_management_client_enums import OverallValidationStatus -from ._data_box_management_client_enums import ShareDestinationFormatType -from ._data_box_management_client_enums import SkuDisabledReason -from ._data_box_management_client_enums import SkuName -from ._data_box_management_client_enums import StageName -from ._data_box_management_client_enums import StageStatus -from ._data_box_management_client_enums import TransportShipmentTypes -from ._data_box_management_client_enums import ValidationInputDiscriminator -from ._data_box_management_client_enums import ValidationStatus -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccountCredentialDetails", - "AddressValidationOutput", - "AddressValidationProperties", - "ApplianceNetworkConfiguration", - "ArmBaseObject", - "AvailableSkuRequest", - "AvailableSkusResult", - "CancellationReason", - "CloudError", - "ContactDetails", - "CopyLogDetails", - "CopyProgress", - "CreateJobValidations", - "CreateOrderLimitForSubscriptionValidationRequest", - "CreateOrderLimitForSubscriptionValidationResponseProperties", - "DataBoxAccountCopyLogDetails", - "DataBoxDiskCopyLogDetails", - "DataBoxDiskCopyProgress", - "DataBoxDiskJobDetails", - "DataBoxDiskJobSecrets", - "DataBoxHeavyAccountCopyLogDetails", - "DataBoxHeavyJobDetails", - "DataBoxHeavyJobSecrets", - "DataBoxHeavySecret", - "DataBoxJobDetails", - "DataBoxScheduleAvailabilityRequest", - "DataBoxSecret", - "DataDestinationDetailsValidationRequest", - "DataDestinationDetailsValidationResponseProperties", - "DataboxJobSecrets", - "DcAccessSecurityCode", - "DestinationAccountDetails", - "DestinationManagedDiskDetails", - "DestinationStorageAccountDetails", - "DestinationToServiceLocationMap", - "DiskScheduleAvailabilityRequest", - "DiskSecret", - "Error", - "HeavyScheduleAvailabilityRequest", - "JobDeliveryInfo", - "JobDetails", - "JobErrorDetails", - "JobResource", - "JobResourceList", - "JobResourceUpdateParameter", - "JobSecrets", - "JobStages", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationList", - "PackageShippingDetails", - "Preferences", - "PreferencesValidationRequest", - "PreferencesValidationResponseProperties", - "RegionConfigurationRequest", - "RegionConfigurationResponse", - "Resource", - "ScheduleAvailabilityRequest", - "ScheduleAvailabilityResponse", - "ShareCredentialDetails", - "ShipmentPickUpRequest", - "ShipmentPickUpResponse", - "ShippingAddress", - "Sku", - "SkuAvailabilityValidationRequest", - "SkuAvailabilityValidationResponseProperties", - "SkuCapacity", - "SkuCost", - "SkuInformation", - "SubscriptionIsAllowedToCreateJobValidationRequest", - "SubscriptionIsAllowedToCreateJobValidationResponseProperties", - "TransportAvailabilityDetails", - "TransportAvailabilityRequest", - "TransportAvailabilityResponse", - "TransportPreferences", - "UnencryptedCredentials", - "UnencryptedCredentialsList", - "UpdateJobDetails", - "ValidateAddress", - "ValidationInputRequest", - "ValidationInputResponse", - "ValidationRequest", - "ValidationResponse", - "AccessProtocol", - "AddressType", - "AddressValidationStatus", - "ClassDiscriminator", - "CopyStatus", - "DataDestinationType", - "JobDeliveryType", - "NotificationStageName", - "OverallValidationStatus", - "ShareDestinationFormatType", - "SkuDisabledReason", - "SkuName", - "StageName", - "StageStatus", - "TransportShipmentTypes", - "ValidationInputDiscriminator", - "ValidationStatus", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_data_box_management_client_enums.py deleted file mode 100644 index 4c8e1acc7084..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_data_box_management_client_enums.py +++ /dev/null @@ -1,264 +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 enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" - - SMB = "SMB" - """Server Message Block protocol(SMB).""" - NFS = "NFS" - """Network File System protocol(NFS).""" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The address validation status.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the type of job details.""" - - DATA_BOX = "DataBox" - """Databox orders.""" - DATA_BOX_DISK = "DataBoxDisk" - """DataboxDisk orders.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """DataboxHeavy orders.""" - - -class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Status of the copy.""" - - NOT_STARTED = "NotStarted" - """Data copy hasn't started yet.""" - IN_PROGRESS = "InProgress" - """Data copy is in progress.""" - COMPLETED = "Completed" - """Data copy completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Data copy completed with errors.""" - FAILED = "Failed" - """Data copy failed. No data was copied.""" - NOT_RETURNED = "NotReturned" - """No copy triggered as device was not returned.""" - HARDWARE_ERROR = "HardwareError" - """The Device has hit hardware issues.""" - DEVICE_FORMATTED = "DeviceFormatted" - """Data copy failed. The Device was formatted by user.""" - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" - """Data copy failed. Device metadata was modified by user.""" - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" - """Data copy failed. Storage Account was not accessible during copy.""" - UNSUPPORTED_DATA = "UnsupportedData" - """Data copy failed. The Device data content is not supported.""" - - -class DataDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data Destination Type.""" - - STORAGE_ACCOUNT = "StorageAccount" - """Storage Accounts .""" - MANAGED_DISK = "ManagedDisk" - """Azure Managed disk storage.""" - - -class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Delivery type of Job.""" - - NON_SCHEDULED = "NonScheduled" - """Non Scheduled job.""" - SCHEDULED = "Scheduled" - """Scheduled job.""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - DEVICE_PREPARED = "DevicePrepared" - """Notification at device prepared stage.""" - DISPATCHED = "Dispatched" - """Notification at device dispatched stage.""" - DELIVERED = "Delivered" - """Notification at device delivered stage.""" - PICKED_UP = "PickedUp" - """Notification at device picked up from user stage.""" - AT_AZURE_DC = "AtAzureDC" - """Notification at device received at azure datacenter stage.""" - DATA_COPY = "DataCopy" - """Notification at data copy started stage.""" - - -class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall validation status.""" - - ALL_VALID_TO_PROCEED = "AllValidToProceed" - """Every input request is valid.""" - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" - """Some input requests are not valid.""" - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" - """Certain input validations skipped.""" - - -class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the share.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown format.""" - HCS = "HCS" - """Storsimple data format.""" - BLOCK_BLOB = "BlockBlob" - """Azure storage block blob format.""" - PAGE_BLOB = "PageBlob" - """Azure storage page blob format.""" - AZURE_FILE = "AzureFile" - """Azure storage file format.""" - MANAGED_DISK = "ManagedDisk" - """Azure Compute Disk.""" - - -class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the Sku is disabled.""" - - NONE = "None" - """SKU is not disabled.""" - COUNTRY = "Country" - """SKU is not available in the requested country.""" - REGION = "Region" - """SKU is not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled for the SKU.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types for the SKU.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" - - DATA_BOX = "DataBox" - """Databox.""" - DATA_BOX_DISK = "DataBoxDisk" - """DataboxDisk.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """DataboxHeavy.""" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage which is in progress.""" - - DEVICE_ORDERED = "DeviceOrdered" - """An order has been created.""" - DEVICE_PREPARED = "DevicePrepared" - """A device has been prepared for the order.""" - DISPATCHED = "Dispatched" - """Device has been dispatched to the user of the order.""" - DELIVERED = "Delivered" - """Device has been delivered to the user of the order.""" - PICKED_UP = "PickedUp" - """Device has been picked up from user and in transit to azure datacenter.""" - AT_AZURE_DC = "AtAzureDC" - """Device has been received at azure datacenter from the user.""" - DATA_COPY = "DataCopy" - """Data copy from the device at azure datacenter.""" - COMPLETED = "Completed" - """Order has completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Order has completed with errors.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" - """Order has failed due to issue reported by user.""" - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" - """Order has failed due to issue detected at azure datacenter.""" - ABORTED = "Aborted" - """Order has been aborted.""" - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - """Order has completed with warnings.""" - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" - """Device is ready to be handed to customer from Azure DC.""" - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" - """Device can be dropped off at Azure DC.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the job stage.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" - """Stage has succeeded with errors.""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Transport Shipment Type supported for given region.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Identifies the type of validation request.""" - - VALIDATE_ADDRESS = "ValidateAddress" - """Identify request and response of address validation.""" - VALIDATE_DATA_DESTINATION_DETAILS = "ValidateDataDestinationDetails" - """Identify request and response of data destination details validation.""" - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" - """Identify request and response for validation of subscription permission to create job.""" - VALIDATE_PREFERENCES = "ValidatePreferences" - """Identify request and response of preference validation.""" - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" - """Identify request and response of create order limit for subscription validation.""" - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" - """Identify request and response of active job limit for sku availability.""" - - -class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Create order limit validation status.""" - - VALID = "Valid" - """Validation is successful""" - INVALID = "Invalid" - """Validation is not successful""" - SKIPPED = "Skipped" - """Validation is skipped""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models_py3.py deleted file mode 100644 index 27c189636275..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models_py3.py +++ /dev/null @@ -1,3855 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union - -from ... import _serialization - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models - - -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_destination_type: Data Destination Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_destination_type: str or - ~azure.mgmt.databox.v2019_09_01.models.DataDestinationType - :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.v2019_09_01.models.ShareCredentialDetails] - """ - - _validation = { - "account_name": {"readonly": True}, - "data_destination_type": {"readonly": True}, - "account_connection_string": {"readonly": True}, - "share_credential_details": {"readonly": True}, - } - - _attribute_map = { - "account_name": {"key": "accountName", "type": "str"}, - "data_destination_type": {"key": "dataDestinationType", "type": "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_destination_type = None - self.account_connection_string = None - self.share_credential_details = None - - -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", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2019_09_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2019_09_01.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": "Error"}, - "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, - DataDestinationDetailsValidationResponseProperties, PreferencesValidationResponseProperties, - SkuAvailabilityValidationResponseProperties, - SubscriptionIsAllowedToCreateJobValidationResponseProperties - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error - """ - - _validation = { - "validation_type": {"required": True}, - "error": {"readonly": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "error": {"key": "error", "type": "Error"}, - } - - _subtype_map = { - "validation_type": { - "ValidateAddress": "AddressValidationProperties", - "ValidateCreateOrderLimit": "CreateOrderLimitForSubscriptionValidationResponseProperties", - "ValidateDataDestinationDetails": "DataDestinationDetailsValidationResponseProperties", - "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 Azure. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2019_09_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2019_09_01.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": "Error"}, - "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 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. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar transfer_type: Type of the transfer. Required. Default value is "ImportToAzure". - :vartype transfer_type: str - :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.v2019_09_01.models.SkuName] - """ - - _validation = { - "transfer_type": {"required": True, "constant": 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]"}, - } - - transfer_type = "ImportToAzure" - - def __init__( - self, - *, - country: str, - location: str, - sku_names: Optional[List[Union[str, "_models.SkuName"]]] = None, - **kwargs: Any - ) -> None: - """ - :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.v2019_09_01.models.SkuName] - """ - super().__init__(**kwargs) - 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.v2019_09_01.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 CancellationReason(_serialization.Model): - """Reason for cancellation. - - All required parameters must be populated in order to send to Azure. - - :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): - """The error information object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Error code string. - :vartype code: str - :ivar message: Descriptive error information. - :vartype message: str - :ivar target: Error target. - :vartype target: str - :ivar details: More detailed error information. - :vartype details: list[~azure.mgmt.databox.v2019_09_01.models.CloudError] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[CloudError]"}, - } - - def __init__( - self, *, target: Optional[str] = None, details: Optional[List["_models.CloudError"]] = None, **kwargs: Any - ) -> None: - """ - :keyword target: Error target. - :paramtype target: str - :keyword details: More detailed error information. - :paramtype details: list[~azure.mgmt.databox.v2019_09_01.models.CloudError] - """ - super().__init__(**kwargs) - self.code = None - self.message = None - self.target = target - self.details = details - - -class ContactDetails(_serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :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.v2019_09_01.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.v2019_09_01.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 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, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails - - All required parameters must be populated in order to send to Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2019_09_01.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", - "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): # pylint: disable=too-many-instance-attributes - """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 where the data needs to be uploaded. - :vartype storage_account_name: str - :ivar data_destination_type: Data Destination Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_destination_type: str or - ~azure.mgmt.databox.v2019_09_01.models.DataDestinationType - :ivar account_id: Id of the account where the data needs to be uploaded. - :vartype account_id: str - :ivar bytes_sent_to_cloud: Amount of data uploaded by the job as of now. - :vartype bytes_sent_to_cloud: 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 by the job as of now. - :vartype files_processed: int - :ivar total_files_to_process: Total number of files to be processed by the job. - :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 - """ - - _validation = { - "storage_account_name": {"readonly": True}, - "data_destination_type": {"readonly": True}, - "account_id": {"readonly": True}, - "bytes_sent_to_cloud": {"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}, - } - - _attribute_map = { - "storage_account_name": {"key": "storageAccountName", "type": "str"}, - "data_destination_type": {"key": "dataDestinationType", "type": "str"}, - "account_id": {"key": "accountId", "type": "str"}, - "bytes_sent_to_cloud": {"key": "bytesSentToCloud", "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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.storage_account_name = None - self.data_destination_type = None - self.account_id = None - self.bytes_sent_to_cloud = 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 - - -class ValidationRequest(_serialization.Model): - """Input request for all pre job creation validation. - - 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 Azure. - - :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.v2019_09_01.models.ValidationInputRequest] - :ivar validation_category: Identify the nature of validation. Required. Default value is - "JobCreationValidation". - :vartype validation_category: str - """ - - _validation = { - "individual_request_details": {"required": True}, - "validation_category": {"required": True}, - } - - _attribute_map = { - "individual_request_details": {"key": "individualRequestDetails", "type": "[ValidationInputRequest]"}, - "validation_category": {"key": "validationCategory", "type": "str"}, - } - - _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.v2019_09_01.models.ValidationInputRequest] - """ - super().__init__(**kwargs) - self.individual_request_details = individual_request_details - self.validation_category: Optional[str] = None - - -class CreateJobValidations(ValidationRequest): - """It does all pre-job creation validations. - - All required parameters must be populated in order to send to Azure. - - :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.v2019_09_01.models.ValidationInputRequest] - :ivar validation_category: Identify the nature of validation. Required. Default value is - "JobCreationValidation". - :vartype validation_category: str - """ - - _validation = { - "individual_request_details": {"required": True}, - "validation_category": {"required": True}, - } - - _attribute_map = { - "individual_request_details": {"key": "individualRequestDetails", "type": "[ValidationInputRequest]"}, - "validation_category": {"key": "validationCategory", "type": "str"}, - } - - 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.v2019_09_01.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, - DataDestinationDetailsValidationRequest, PreferencesValidationRequest, - SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest - - All required parameters must be populated in order to send to Azure. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - """ - - _validation = { - "validation_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - } - - _subtype_map = { - "validation_type": { - "ValidateAddress": "ValidateAddress", - "ValidateCreateOrderLimit": "CreateOrderLimitForSubscriptionValidationRequest", - "ValidateDataDestinationDetails": "DataDestinationDetailsValidationRequest", - "ValidatePreferences": "PreferencesValidationRequest", - "ValidateSkuAvailability": "SkuAvailabilityValidationRequest", - "ValidateSubscriptionIsAllowedToCreateJob": "SubscriptionIsAllowedToCreateJobValidationRequest", - } - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: Optional[str] = None - - -class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - } - - def __init__(self, *, device_type: Union[str, "_models.SkuName"], **kwargs: Any) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.device_type = device_type - - -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error - :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2019_09_01.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": "Error"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.status = None - - -class DataBoxAccountCopyLogDetails(CopyLogDetails): - """Copy log details for a storage account of a DataBox job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator - :ivar account_name: Destination account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: str - """ - - _validation = { - "copy_log_details_type": {"required": True}, - "account_name": {"readonly": True}, - "copy_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"}, - } - - 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 - - -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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2019_09_01.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", and - "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.v2019_09_01.models.CopyStatus - """ - - _validation = { - "serial_number": {"readonly": True}, - "bytes_copied": {"readonly": True}, - "percent_complete": {"readonly": True}, - "status": {"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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Job details. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DataBoxJobDetails, 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 Azure. - - :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 job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2019_09_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails - :ivar destination_account_details: Destination account details. Required. - :vartype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.v2019_09_01.models.JobErrorDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2019_09_01.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 - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "shipping_address": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"readonly": True}, - "destination_account_details": {"required": True}, - "error_details": {"readonly": True}, - "job_details_type": {"required": True}, - "copy_log_details": {"readonly": True}, - "reverse_shipment_label_sas_key": {"readonly": True}, - "chain_of_custody_sas_key": {"readonly": True}, - } - - _attribute_map = { - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "job_stages": {"key": "jobStages", "type": "[JobStages]"}, - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "delivery_package": {"key": "deliveryPackage", "type": "PackageShippingDetails"}, - "return_package": {"key": "returnPackage", "type": "PackageShippingDetails"}, - "destination_account_details": {"key": "destinationAccountDetails", "type": "[DestinationAccountDetails]"}, - "error_details": {"key": "errorDetails", "type": "[JobErrorDetails]"}, - "job_details_type": {"key": "jobDetailsType", "type": "str"}, - "preferences": {"key": "preferences", "type": "Preferences"}, - "copy_log_details": {"key": "copyLogDetails", "type": "[CopyLogDetails]"}, - "reverse_shipment_label_sas_key": {"key": "reverseShipmentLabelSasKey", "type": "str"}, - "chain_of_custody_sas_key": {"key": "chainOfCustodySasKey", "type": "str"}, - } - - _subtype_map = { - "job_details_type": { - "DataBox": "DataBoxJobDetails", - "DataBoxDisk": "DataBoxDiskJobDetails", - "DataBoxHeavy": "DataBoxHeavyJobDetails", - } - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: "_models.ShippingAddress", - destination_account_details: List["_models.DestinationAccountDetails"], - expected_data_size_in_tera_bytes: Optional[int] = None, - preferences: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :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 contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - :keyword destination_account_details: Destination account details. Required. - :paramtype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences - """ - super().__init__(**kwargs) - self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes - self.job_stages = None - self.contact_details = contact_details - self.shipping_address = shipping_address - self.delivery_package = None - self.return_package = None - self.destination_account_details = destination_account_details - self.error_details = None - self.job_details_type: Optional[str] = None - self.preferences = preferences - self.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = None - - -class DataBoxDiskJobDetails(JobDetails): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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 job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2019_09_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails - :ivar destination_account_details: Destination account details. Required. - :vartype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.v2019_09_01.models.JobErrorDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2019_09_01.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 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.v2019_09_01.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :ivar passkey: User entered passkey for DataBox Disk job. - :vartype passkey: str - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "shipping_address": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"readonly": True}, - "destination_account_details": {"required": True}, - "error_details": {"readonly": True}, - "job_details_type": {"required": True}, - "copy_log_details": {"readonly": True}, - "reverse_shipment_label_sas_key": {"readonly": True}, - "chain_of_custody_sas_key": {"readonly": True}, - "copy_progress": {"readonly": True}, - "disks_and_size_details": {"readonly": True}, - } - - _attribute_map = { - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "job_stages": {"key": "jobStages", "type": "[JobStages]"}, - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "delivery_package": {"key": "deliveryPackage", "type": "PackageShippingDetails"}, - "return_package": {"key": "returnPackage", "type": "PackageShippingDetails"}, - "destination_account_details": {"key": "destinationAccountDetails", "type": "[DestinationAccountDetails]"}, - "error_details": {"key": "errorDetails", "type": "[JobErrorDetails]"}, - "job_details_type": {"key": "jobDetailsType", "type": "str"}, - "preferences": {"key": "preferences", "type": "Preferences"}, - "copy_log_details": {"key": "copyLogDetails", "type": "[CopyLogDetails]"}, - "reverse_shipment_label_sas_key": {"key": "reverseShipmentLabelSasKey", "type": "str"}, - "chain_of_custody_sas_key": {"key": "chainOfCustodySasKey", "type": "str"}, - "preferred_disks": {"key": "preferredDisks", "type": "{int}"}, - "copy_progress": {"key": "copyProgress", "type": "[DataBoxDiskCopyProgress]"}, - "disks_and_size_details": {"key": "disksAndSizeDetails", "type": "{int}"}, - "passkey": {"key": "passkey", "type": "str"}, - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: "_models.ShippingAddress", - destination_account_details: List["_models.DestinationAccountDetails"], - expected_data_size_in_tera_bytes: Optional[int] = None, - preferences: Optional["_models.Preferences"] = None, - preferred_disks: Optional[Dict[str, int]] = None, - passkey: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :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 contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - :keyword destination_account_details: Destination account details. Required. - :paramtype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences - :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__( - expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, - contact_details=contact_details, - shipping_address=shipping_address, - destination_account_details=destination_account_details, - preferences=preferences, - **kwargs - ) - self.job_details_type: str = "DataBoxDisk" - self.preferred_disks = preferred_disks - self.copy_progress = None - self.disks_and_size_details = None - self.passkey = passkey - - -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, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets - - All required parameters must be populated in order to send to Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode - """ - - _validation = { - "job_secrets_type": {"required": True}, - } - - _attribute_map = { - "job_secrets_type": {"key": "jobSecretsType", "type": "str"}, - "dc_access_security_code": {"key": "dcAccessSecurityCode", "type": "DcAccessSecurityCode"}, - } - - _subtype_map = { - "job_secrets_type": { - "DataBox": "DataboxJobSecrets", - "DataBoxDisk": "DataBoxDiskJobSecrets", - "DataBoxHeavy": "DataBoxHeavyJobSecrets", - } - } - - def __init__( - self, *, dc_access_security_code: Optional["_models.DcAccessSecurityCode"] = None, **kwargs: Any - ) -> None: - """ - :keyword dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :paramtype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode - """ - super().__init__(**kwargs) - self.job_secrets_type: Optional[str] = None - self.dc_access_security_code = dc_access_security_code - - -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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2019_09_01.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}, - "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"}, - "disk_secrets": {"key": "diskSecrets", "type": "[DiskSecret]"}, - "pass_key": {"key": "passKey", "type": "str"}, - "is_passkey_user_defined": {"key": "isPasskeyUserDefined", "type": "bool"}, - } - - def __init__( - self, *, dc_access_security_code: Optional["_models.DcAccessSecurityCode"] = None, **kwargs: Any - ) -> None: - """ - :keyword dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :paramtype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode - """ - super().__init__(dc_access_security_code=dc_access_security_code, **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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator - :ivar account_name: Destination account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: list[str] - """ - - _validation = { - "copy_log_details_type": {"required": True}, - "account_name": {"readonly": True}, - "copy_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]"}, - } - - 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 - - -class DataBoxHeavyJobDetails(JobDetails): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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 job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2019_09_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails - :ivar destination_account_details: Destination account details. Required. - :vartype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.v2019_09_01.models.JobErrorDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2019_09_01.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 copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.v2019_09_01.models.CopyProgress] - :ivar device_password: Set Device password for unlocking Databox Heavy. - :vartype device_password: str - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "shipping_address": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"readonly": True}, - "destination_account_details": {"required": True}, - "error_details": {"readonly": True}, - "job_details_type": {"required": True}, - "copy_log_details": {"readonly": True}, - "reverse_shipment_label_sas_key": {"readonly": True}, - "chain_of_custody_sas_key": {"readonly": True}, - "copy_progress": {"readonly": True}, - } - - _attribute_map = { - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "job_stages": {"key": "jobStages", "type": "[JobStages]"}, - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "delivery_package": {"key": "deliveryPackage", "type": "PackageShippingDetails"}, - "return_package": {"key": "returnPackage", "type": "PackageShippingDetails"}, - "destination_account_details": {"key": "destinationAccountDetails", "type": "[DestinationAccountDetails]"}, - "error_details": {"key": "errorDetails", "type": "[JobErrorDetails]"}, - "job_details_type": {"key": "jobDetailsType", "type": "str"}, - "preferences": {"key": "preferences", "type": "Preferences"}, - "copy_log_details": {"key": "copyLogDetails", "type": "[CopyLogDetails]"}, - "reverse_shipment_label_sas_key": {"key": "reverseShipmentLabelSasKey", "type": "str"}, - "chain_of_custody_sas_key": {"key": "chainOfCustodySasKey", "type": "str"}, - "copy_progress": {"key": "copyProgress", "type": "[CopyProgress]"}, - "device_password": {"key": "devicePassword", "type": "str"}, - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: "_models.ShippingAddress", - destination_account_details: List["_models.DestinationAccountDetails"], - expected_data_size_in_tera_bytes: Optional[int] = None, - preferences: Optional["_models.Preferences"] = None, - device_password: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :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 contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - :keyword destination_account_details: Destination account details. Required. - :paramtype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences - :keyword device_password: Set Device password for unlocking Databox Heavy. - :paramtype device_password: str - """ - super().__init__( - expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, - contact_details=contact_details, - shipping_address=shipping_address, - destination_account_details=destination_account_details, - preferences=preferences, - **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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode - :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.v2019_09_01.models.DataBoxHeavySecret] - """ - - _validation = { - "job_secrets_type": {"required": True}, - "cabinet_pod_secrets": {"readonly": True}, - } - - _attribute_map = { - "job_secrets_type": {"key": "jobSecretsType", "type": "str"}, - "dc_access_security_code": {"key": "dcAccessSecurityCode", "type": "DcAccessSecurityCode"}, - "cabinet_pod_secrets": {"key": "cabinetPodSecrets", "type": "[DataBoxHeavySecret]"}, - } - - def __init__( - self, *, dc_access_security_code: Optional["_models.DcAccessSecurityCode"] = None, **kwargs: Any - ) -> None: - """ - :keyword dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :paramtype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode - """ - super().__init__(dc_access_security_code=dc_access_security_code, **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.v2019_09_01.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.v2019_09_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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 job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2019_09_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails - :ivar destination_account_details: Destination account details. Required. - :vartype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.v2019_09_01.models.JobErrorDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2019_09_01.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 copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.v2019_09_01.models.CopyProgress] - :ivar device_password: Set Device password for unlocking Databox. - :vartype device_password: str - """ - - _validation = { - "job_stages": {"readonly": True}, - "contact_details": {"required": True}, - "shipping_address": {"required": True}, - "delivery_package": {"readonly": True}, - "return_package": {"readonly": True}, - "destination_account_details": {"required": True}, - "error_details": {"readonly": True}, - "job_details_type": {"required": True}, - "copy_log_details": {"readonly": True}, - "reverse_shipment_label_sas_key": {"readonly": True}, - "chain_of_custody_sas_key": {"readonly": True}, - "copy_progress": {"readonly": True}, - } - - _attribute_map = { - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "job_stages": {"key": "jobStages", "type": "[JobStages]"}, - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "delivery_package": {"key": "deliveryPackage", "type": "PackageShippingDetails"}, - "return_package": {"key": "returnPackage", "type": "PackageShippingDetails"}, - "destination_account_details": {"key": "destinationAccountDetails", "type": "[DestinationAccountDetails]"}, - "error_details": {"key": "errorDetails", "type": "[JobErrorDetails]"}, - "job_details_type": {"key": "jobDetailsType", "type": "str"}, - "preferences": {"key": "preferences", "type": "Preferences"}, - "copy_log_details": {"key": "copyLogDetails", "type": "[CopyLogDetails]"}, - "reverse_shipment_label_sas_key": {"key": "reverseShipmentLabelSasKey", "type": "str"}, - "chain_of_custody_sas_key": {"key": "chainOfCustodySasKey", "type": "str"}, - "copy_progress": {"key": "copyProgress", "type": "[CopyProgress]"}, - "device_password": {"key": "devicePassword", "type": "str"}, - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: "_models.ShippingAddress", - destination_account_details: List["_models.DestinationAccountDetails"], - expected_data_size_in_tera_bytes: Optional[int] = None, - preferences: Optional["_models.Preferences"] = None, - device_password: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :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 contact_details: Contact details for notification and shipping. Required. - :paramtype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - :keyword destination_account_details: Destination account details. Required. - :paramtype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences - :keyword device_password: Set Device password for unlocking Databox. - :paramtype device_password: str - """ - super().__init__( - expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, - contact_details=contact_details, - shipping_address=shipping_address, - destination_account_details=destination_account_details, - preferences=preferences, - **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. - - All required parameters must be populated in order to send to Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.v2019_09_01.models.DataBoxSecret] - """ - - _validation = { - "job_secrets_type": {"required": True}, - } - - _attribute_map = { - "job_secrets_type": {"key": "jobSecretsType", "type": "str"}, - "dc_access_security_code": {"key": "dcAccessSecurityCode", "type": "DcAccessSecurityCode"}, - "pod_secrets": {"key": "podSecrets", "type": "[DataBoxSecret]"}, - } - - def __init__( - self, - *, - dc_access_security_code: Optional["_models.DcAccessSecurityCode"] = None, - pod_secrets: Optional[List["_models.DataBoxSecret"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :paramtype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode - :keyword pod_secrets: Contains the list of secret objects for a job. - :paramtype pod_secrets: list[~azure.mgmt.databox.v2019_09_01.models.DataBoxSecret] - """ - super().__init__(dc_access_security_code=dc_access_security_code, **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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - } - - _subtype_map = { - "sku_name": { - "DataBox": "DataBoxScheduleAvailabilityRequest", - "DataBoxDisk": "DiskScheduleAvailabilityRequest", - "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", - } - } - - def __init__(self, *, storage_location: str, **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 - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name: Optional[str] = None - - -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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, storage_location: str, **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 - """ - super().__init__(storage_location=storage_location, **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.v2019_09_01.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.v2019_09_01.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 DataDestinationDetailsValidationRequest(ValidationInputRequest): - """Request to validate data destination details. - - All required parameters must be populated in order to send to Azure. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar destination_account_details: Destination account details list. Required. - :vartype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - :ivar location: Location of stamp or geo. Required. - :vartype location: str - """ - - _validation = { - "validation_type": {"required": True}, - "destination_account_details": {"required": True}, - "location": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "destination_account_details": {"key": "destinationAccountDetails", "type": "[DestinationAccountDetails]"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__( - self, *, destination_account_details: List["_models.DestinationAccountDetails"], location: str, **kwargs: Any - ) -> None: - """ - :keyword destination_account_details: Destination account details list. Required. - :paramtype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - :keyword location: Location of stamp or geo. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateDataDestinationDetails" - self.destination_account_details = destination_account_details - self.location = location - - -class DataDestinationDetailsValidationResponseProperties(ValidationInputResponse): - """Properties of data destination details validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error - :ivar status: Data destination details validation status. Known values are: "Valid", "Invalid", - and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2019_09_01.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": "Error"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateDataDestinationDetails" - self.status = None - - -class DcAccessSecurityCode(_serialization.Model): - """Dc Access Security code for device. - - :ivar forward_dc_access_code: Dc Access Code for dispatching from DC. - :vartype forward_dc_access_code: str - :ivar reverse_dc_access_code: Dc Access code for dropping off at DC. - :vartype reverse_dc_access_code: str - """ - - _attribute_map = { - "forward_dc_access_code": {"key": "forwardDCAccessCode", "type": "str"}, - "reverse_dc_access_code": {"key": "reverseDCAccessCode", "type": "str"}, - } - - def __init__( - self, - *, - forward_dc_access_code: Optional[str] = None, - reverse_dc_access_code: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword forward_dc_access_code: Dc Access Code for dispatching from DC. - :paramtype forward_dc_access_code: str - :keyword reverse_dc_access_code: Dc Access code for dropping off at DC. - :paramtype reverse_dc_access_code: str - """ - super().__init__(**kwargs) - self.forward_dc_access_code = forward_dc_access_code - self.reverse_dc_access_code = reverse_dc_access_code - - -class DestinationAccountDetails(_serialization.Model): - """Details of the destination storage accounts. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DestinationManagedDiskDetails, DestinationStorageAccountDetails - - All required parameters must be populated in order to send to Azure. - - :ivar data_destination_type: Data Destination Type. Required. Known values are: - "StorageAccount" and "ManagedDisk". - :vartype data_destination_type: str or - ~azure.mgmt.databox.v2019_09_01.models.DataDestinationType - :ivar account_id: Arm Id of the destination where the data has to be moved. - :vartype account_id: str - :ivar share_password: Share password to be shared by all shares in SA. - :vartype share_password: str - """ - - _validation = { - "data_destination_type": {"required": True}, - } - - _attribute_map = { - "data_destination_type": {"key": "dataDestinationType", "type": "str"}, - "account_id": {"key": "accountId", "type": "str"}, - "share_password": {"key": "sharePassword", "type": "str"}, - } - - _subtype_map = { - "data_destination_type": { - "ManagedDisk": "DestinationManagedDiskDetails", - "StorageAccount": "DestinationStorageAccountDetails", - } - } - - def __init__( - self, *, account_id: Optional[str] = None, share_password: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword account_id: Arm Id of the destination where the data has to be moved. - :paramtype account_id: str - :keyword share_password: Share password to be shared by all shares in SA. - :paramtype share_password: str - """ - super().__init__(**kwargs) - self.data_destination_type: Optional[str] = None - self.account_id = account_id - self.share_password = share_password - - -class DestinationManagedDiskDetails(DestinationAccountDetails): - """Details for the destination compute disks. - - All required parameters must be populated in order to send to Azure. - - :ivar data_destination_type: Data Destination Type. Required. Known values are: - "StorageAccount" and "ManagedDisk". - :vartype data_destination_type: str or - ~azure.mgmt.databox.v2019_09_01.models.DataDestinationType - :ivar account_id: Arm Id of the destination where the data has to be moved. - :vartype account_id: str - :ivar share_password: Share password to be shared by all shares in SA. - :vartype share_password: str - :ivar resource_group_id: Destination Resource Group Id where the Compute disks should be - created. Required. - :vartype resource_group_id: str - :ivar staging_storage_account_id: Arm Id of the storage account that can be used to copy the - vhd for staging. Required. - :vartype staging_storage_account_id: str - """ - - _validation = { - "data_destination_type": {"required": True}, - "resource_group_id": {"required": True}, - "staging_storage_account_id": {"required": True}, - } - - _attribute_map = { - "data_destination_type": {"key": "dataDestinationType", "type": "str"}, - "account_id": {"key": "accountId", "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, - account_id: Optional[str] = None, - share_password: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword account_id: Arm Id of the destination where the data has to be moved. - :paramtype account_id: str - :keyword share_password: Share password to be shared by all shares in SA. - :paramtype share_password: str - :keyword resource_group_id: Destination Resource Group Id where the Compute disks should be - created. Required. - :paramtype resource_group_id: str - :keyword staging_storage_account_id: Arm Id of the storage account that can be used to copy the - vhd for staging. Required. - :paramtype staging_storage_account_id: str - """ - super().__init__(account_id=account_id, share_password=share_password, **kwargs) - self.data_destination_type: str = "ManagedDisk" - self.resource_group_id = resource_group_id - self.staging_storage_account_id = staging_storage_account_id - - -class DestinationStorageAccountDetails(DestinationAccountDetails): - """Details for the destination storage account. - - All required parameters must be populated in order to send to Azure. - - :ivar data_destination_type: Data Destination Type. Required. Known values are: - "StorageAccount" and "ManagedDisk". - :vartype data_destination_type: str or - ~azure.mgmt.databox.v2019_09_01.models.DataDestinationType - :ivar account_id: Arm Id of the destination where the data has to be moved. - :vartype account_id: str - :ivar share_password: Share password to be shared by all shares in SA. - :vartype share_password: str - :ivar storage_account_id: Destination Storage Account Arm Id. Required. - :vartype storage_account_id: str - """ - - _validation = { - "data_destination_type": {"required": True}, - "storage_account_id": {"required": True}, - } - - _attribute_map = { - "data_destination_type": {"key": "dataDestinationType", "type": "str"}, - "account_id": {"key": "accountId", "type": "str"}, - "share_password": {"key": "sharePassword", "type": "str"}, - "storage_account_id": {"key": "storageAccountId", "type": "str"}, - } - - def __init__( - self, - *, - storage_account_id: str, - account_id: Optional[str] = None, - share_password: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword account_id: Arm Id of the destination where the data has to be moved. - :paramtype account_id: str - :keyword share_password: Share password to be shared by all shares in SA. - :paramtype share_password: str - :keyword storage_account_id: Destination Storage Account Arm Id. Required. - :paramtype storage_account_id: str - """ - super().__init__(account_id=account_id, share_password=share_password, **kwargs) - self.data_destination_type: str = "StorageAccount" - self.storage_account_id = storage_account_id - - -class DestinationToServiceLocationMap(_serialization.Model): - """Map of destination location to service location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar destination_location: Location of the destination. - :vartype destination_location: str - :ivar service_location: Location of the service. - :vartype service_location: str - """ - - _validation = { - "destination_location": {"readonly": True}, - "service_location": {"readonly": True}, - } - - _attribute_map = { - "destination_location": {"key": "destinationLocation", "type": "str"}, - "service_location": {"key": "serviceLocation", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.destination_location = None - self.service_location = 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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - :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"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - } - - def __init__(self, *, storage_location: str, expected_data_size_in_tera_bytes: int, **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 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, **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 Error(_serialization.Model): - """Top level error for the job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Error code that can be used to programmatically identify the error. - :vartype code: str - :ivar message: Describes the error in detail and provides debugging information. - :vartype message: str - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code = None - self.message = None - - -class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling heavy orders. - - All required parameters must be populated in order to send to Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, storage_location: str, **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 - """ - super().__init__(storage_location=storage_location, **kwargs) - self.sku_name: str = "DataBoxHeavy" - - -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 JobErrorDetails(_serialization.Model): - """Job Error Details for providing the information and recommended action. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error_message: Message for the error. - :vartype error_message: str - :ivar error_code: Code for the error. - :vartype error_code: int - :ivar recommended_action: Recommended action for the error. - :vartype recommended_action: str - :ivar exception_message: Contains the non localized exception message. - :vartype exception_message: str - """ - - _validation = { - "error_message": {"readonly": True}, - "error_code": {"readonly": True}, - "recommended_action": {"readonly": True}, - "exception_message": {"readonly": True}, - } - - _attribute_map = { - "error_message": {"key": "errorMessage", "type": "str"}, - "error_code": {"key": "errorCode", "type": "int"}, - "recommended_action": {"key": "recommendedAction", "type": "str"}, - "exception_message": {"key": "exceptionMessage", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.error_message = None - self.error_code = None - self.recommended_action = None - self.exception_message = None - - -class Resource(_serialization.Model): - """Model of the Resource. - - All required parameters must be populated in order to send to Azure. - - :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.v2019_09_01.models.Sku - """ - - _validation = { - "location": {"required": True}, - "sku": {"required": True}, - } - - _attribute_map = { - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - } - - def __init__( - self, *, location: str, sku: "_models.Sku", tags: Optional[Dict[str, str]] = 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.v2019_09_01.models.Sku - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - - -class JobResource(Resource): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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.v2019_09_01.models.Sku - :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 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 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", and "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.v2019_09_01.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.v2019_09_01.models.Error - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.v2019_09_01.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.v2019_09_01.models.JobDeliveryType - :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.v2019_09_01.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: bool - """ - - _validation = { - "location": {"required": True}, - "sku": {"required": True}, - "name": {"readonly": True}, - "id": {"readonly": True}, - "type": {"readonly": True}, - "is_cancellable": {"readonly": True}, - "is_deletable": {"readonly": True}, - "is_shipping_address_editable": {"readonly": True}, - "status": {"readonly": True}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "is_cancellable_without_fee": {"readonly": True}, - } - - _attribute_map = { - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "name": {"key": "name", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "is_cancellable": {"key": "properties.isCancellable", "type": "bool"}, - "is_deletable": {"key": "properties.isDeletable", "type": "bool"}, - "is_shipping_address_editable": {"key": "properties.isShippingAddressEditable", "type": "bool"}, - "status": {"key": "properties.status", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "error": {"key": "properties.error", "type": "Error"}, - "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"}, - } - - def __init__( - self, - *, - location: str, - sku: "_models.Sku", - tags: Optional[Dict[str, str]] = 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.v2019_09_01.models.Sku - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.v2019_09_01.models.JobDetails - :keyword delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :paramtype delivery_type: str or ~azure.mgmt.databox.v2019_09_01.models.JobDeliveryType - :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.v2019_09_01.models.JobDeliveryInfo - """ - super().__init__(location=location, tags=tags, sku=sku, **kwargs) - self.name = None - self.id = None - self.type = None - self.is_cancellable = None - self.is_deletable = None - self.is_shipping_address_editable = None - self.status = None - self.start_time = None - self.error = None - self.details = details - self.cancellation_reason = None - self.delivery_type = delivery_type - self.delivery_info = delivery_info - self.is_cancellable_without_fee = None - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2019_09_01.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.v2019_09_01.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 details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2019_09_01.models.UpdateJobDetails - :ivar destination_account_details: Destination account details. - :vartype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "details": {"key": "properties.details", "type": "UpdateJobDetails"}, - "destination_account_details": { - "key": "properties.destinationAccountDetails", - "type": "[DestinationAccountDetails]", - }, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - details: Optional["_models.UpdateJobDetails"] = None, - destination_account_details: Optional[List["_models.DestinationAccountDetails"]] = 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 details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2019_09_01.models.UpdateJobDetails - :keyword destination_account_details: Destination account details. - :paramtype destination_account_details: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] - """ - super().__init__(**kwargs) - self.tags = tags - self.details = details - self.destination_account_details = destination_account_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", and "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.v2019_09_01.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", and "SucceededWithErrors". - :vartype stage_status: str or ~azure.mgmt.databox.v2019_09_01.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 error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.v2019_09_01.models.JobErrorDetails] - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"readonly": True}, - "error_details": {"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"}, - "error_details": {"key": "errorDetails", "type": "[JobErrorDetails]"}, - } - - 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.error_details = None - - -class NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :ivar stage_name: Name of the stage. Required. Known values are: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", and "DataCopy". - :vartype stage_name: str or ~azure.mgmt.databox.v2019_09_01.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", and "DataCopy". - :paramtype stage_name: str or ~azure.mgmt.databox.v2019_09_01.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.v2019_09_01.models.OperationDisplay - :ivar properties: Operation properties. - :vartype properties: JSON - :ivar origin: Origin of the operation. Can be : user|system|user,system. - :vartype origin: str - """ - - _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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.display = None - self.properties = None - self.origin = None - - -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.v2019_09_01.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 PackageShippingDetails(_serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar tracking_id: Tracking Id of shipment. - :vartype tracking_id: str - :ivar tracking_url: Url where shipment can be tracked. - :vartype tracking_url: str - """ - - _validation = { - "carrier_name": {"readonly": True}, - "tracking_id": {"readonly": True}, - "tracking_url": {"readonly": True}, - } - - _attribute_map = { - "carrier_name": {"key": "carrierName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - "tracking_url": {"key": "trackingUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = 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.v2019_09_01.models.TransportPreferences - """ - - _attribute_map = { - "preferred_data_center_region": {"key": "preferredDataCenterRegion", "type": "[str]"}, - "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, - } - - def __init__( - self, - *, - preferred_data_center_region: Optional[List[str]] = None, - transport_preferences: Optional["_models.TransportPreferences"] = 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.v2019_09_01.models.TransportPreferences - """ - super().__init__(**kwargs) - self.preferred_data_center_region = preferred_data_center_region - self.transport_preferences = transport_preferences - - -class PreferencesValidationRequest(ValidationInputRequest): - """Request to validate preference of transport and data center. - - All required parameters must be populated in order to send to Azure. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar preference: Preference requested with respect to transport type and data center. - :vartype preference: ~azure.mgmt.databox.v2019_09_01.models.Preferences - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - preference: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: Preference requested with respect to transport type and data center. - :paramtype preference: ~azure.mgmt.databox.v2019_09_01.models.Preferences - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.preference = preference - self.device_type = device_type - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error - :ivar status: Validation status of requested data center and transport. Known values are: - "Valid", "Invalid", and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2019_09_01.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": "Error"}, - "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.v2019_09_01.models.ScheduleAvailabilityRequest - :ivar transport_availability_request: Request body to get the transport availability for given - sku. - :vartype transport_availability_request: - ~azure.mgmt.databox.v2019_09_01.models.TransportAvailabilityRequest - """ - - _attribute_map = { - "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, - "transport_availability_request": { - "key": "transportAvailabilityRequest", - "type": "TransportAvailabilityRequest", - }, - } - - def __init__( - self, - *, - schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_availability_request: Request body to get the availability for scheduling - orders. - :paramtype schedule_availability_request: - ~azure.mgmt.databox.v2019_09_01.models.ScheduleAvailabilityRequest - :keyword transport_availability_request: Request body to get the transport availability for - given sku. - :paramtype transport_availability_request: - ~azure.mgmt.databox.v2019_09_01.models.TransportAvailabilityRequest - """ - super().__init__(**kwargs) - self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_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.v2019_09_01.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.v2019_09_01.models.TransportAvailabilityResponse - """ - - _validation = { - "schedule_availability_response": {"readonly": True}, - "transport_availability_response": {"readonly": True}, - } - - _attribute_map = { - "schedule_availability_response": { - "key": "scheduleAvailabilityResponse", - "type": "ScheduleAvailabilityResponse", - }, - "transport_availability_response": { - "key": "transportAvailabilityResponse", - "type": "TransportAvailabilityResponse", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_response = None - - -class ScheduleAvailabilityResponse(_serialization.Model): - """Schedule availability response 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.v2019_09_01.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.v2019_09_01.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 Azure. - - :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 Azure. - - :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. Required. - :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.v2019_09_01.models.AddressType - """ - - _validation = { - "street_address1": {"required": True}, - "country": {"required": True}, - "postal_code": {"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"}, - } - - def __init__( - self, - *, - street_address1: str, - country: str, - postal_code: str, - street_address2: Optional[str] = None, - street_address3: Optional[str] = None, - city: Optional[str] = None, - state_or_province: Optional[str] = None, - zip_extended_code: Optional[str] = None, - company_name: Optional[str] = None, - address_type: Union[str, "_models.AddressType"] = "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. Required. - :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.v2019_09_01.models.AddressType - """ - 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 - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :vartype name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Default value is "ImportToAzure". - :vartype transfer_type: str - :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 - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - "transfer_type": {"required": True, "constant": 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"}, - } - - transfer_type = "ImportToAzure" - - def __init__( - self, *, device_type: Union[str, "_models.SkuName"], country: str, location: str, **kwargs: Any - ) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - :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 - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.device_type = device_type - self.country = country - self.location = location - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error - :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2019_09_01.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": "Error"}, - "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 - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = 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 - """ - - _validation = { - "meter_id": {"readonly": True}, - "meter_type": {"readonly": True}, - } - - _attribute_map = { - "meter_id": {"key": "meterId", "type": "str"}, - "meter_type": {"key": "meterType", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.meter_id = None - self.meter_type = 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.v2019_09_01.models.Sku - :ivar enabled: The sku is enabled or not. - :vartype enabled: bool - :ivar destination_to_service_location_map: The map of destination location to service location. - :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.v2019_09_01.models.DestinationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2019_09_01.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2019_09_01.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.v2019_09_01.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 - """ - - _validation = { - "sku": {"readonly": True}, - "enabled": {"readonly": True}, - "destination_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}, - } - - _attribute_map = { - "sku": {"key": "sku", "type": "Sku"}, - "enabled": {"key": "enabled", "type": "bool"}, - "destination_to_service_location_map": { - "key": "properties.destinationToServiceLocationMap", - "type": "[DestinationToServiceLocationMap]", - }, - "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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.sku = None - self.enabled = None - self.destination_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 - - -class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.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): - """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 Azure. - - :ivar validation_type: Identifies the type of validation response. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error - :ivar status: Validation status of subscription permission to create job. Known values are: - "Valid", "Invalid", and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2019_09_01.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": "Error"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSubscriptionIsAllowedToCreateJob" - self.status = None - - -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.v2019_09_01.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", and - "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = None, **kwargs: Any) -> None: - """ - :keyword sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - - -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.v2019_09_01.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. - - All required parameters must be populated in order to send to Azure. - - :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.v2019_09_01.models.TransportShipmentTypes - """ - - _validation = { - "preferred_shipment_type": {"required": True}, - } - - _attribute_map = { - "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, - } - - 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.v2019_09_01.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type - - -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.v2019_09_01.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.v2019_09_01.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.v2019_09_01.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.v2019_09_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - """ - - _attribute_map = { - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - } - - def __init__( - self, - *, - contact_details: Optional["_models.ContactDetails"] = None, - shipping_address: Optional["_models.ShippingAddress"] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. - :paramtype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - """ - super().__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address - - -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 Azure. - - :ivar validation_type: Identifies the type of validation request. Required. Known values are: - "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - and "ValidateSkuAvailability". - :vartype validation_type: str or - ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: ~azure.mgmt.databox.v2019_09_01.models.TransportPreferences - """ - - _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"}, - } - - def __init__( - self, - *, - shipping_address: "_models.ShippingAddress", - device_type: Union[str, "_models.SkuName"], - transport_preferences: Optional["_models.TransportPreferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: ~azure.mgmt.databox.v2019_09_01.models.TransportPreferences - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.shipping_address = shipping_address - self.device_type = device_type - self.transport_preferences = transport_preferences - - -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.v2019_09_01.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.v2019_09_01.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/v2019_09_01/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/__init__.py deleted file mode 100644 index 351b58b163ad..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/__init__.py +++ /dev/null @@ -1,23 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_jobs_operations.py deleted file mode 100644 index c36c15bdc8a4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_jobs_operations.py +++ /dev/null @@ -1,1544 +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 typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, 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.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .._vendor import _convert_request, _format_url_section - -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", "2019-09-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 = _format_url_section(_url, **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_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", "2019-09-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 = _format_url_section(_url, **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", "2019-09-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 = _format_url_section(_url, **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", "2019-09-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 = _format_url_section(_url, **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", "2019-09-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 = _format_url_section(_url, **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", "2019-09-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 = _format_url_section(_url, **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", "2019-09-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 = _format_url_section(_url, **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", "2019-09-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 = _format_url_section(_url, **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", "2019-09-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 = _format_url_section(_url, **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.v2019_09_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2019-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2019_09_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2019_09_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2019_09_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2019_09_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2019-09-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2019-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2019_09_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2019_09_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2019_09_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2019_09_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2019_09_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2019_09_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - 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.v2019_09_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2019_09_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_operations.py deleted file mode 100644 index 7dd09d7e3cf1..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_operations.py +++ /dev/null @@ -1,154 +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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar -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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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 _convert_request - -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(**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", "2019-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2019_09_01.DataBoxManagementClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.models.Operation] - :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", "2019-09-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_service_operations.py deleted file mode 100644 index 583c0b444d58..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_service_operations.py +++ /dev/null @@ -1,1071 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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 _convert_request, _format_url_section - -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_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", "2019-09-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}/availableSkus" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _format_url_section(_url, **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_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", "2019-09-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 = _format_url_section(_url, **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", "2019-09-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 = _format_url_section(_url, **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", "2019-09-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 = _format_url_section(_url, **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", "2019-09-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 = _format_url_section(_url, **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", "2019-09-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 = _format_url_section(_url, **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.v2019_09_01.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( - self, - 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 and location. - - :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.v2019_09_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_available_skus( - self, location: str, available_sku_request: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> Iterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription and location. - - :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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.models.SkuInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_available_skus( - self, location: str, available_sku_request: Union[_models.AvailableSkuRequest, IO], **kwargs: Any - ) -> Iterable["_models.SkuInformation"]: - """This method provides the list of available skus for the given subscription and location. - - :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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_available_skus.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_available_skus.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2019_09_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.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", "2019-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2019_09_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2019_09_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AddressValidationOutput", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2019_09_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ValidationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2019_09_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ValidationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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. - - :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.v2019_09_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration( - self, location: str, region_configuration_request: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location. - - :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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **kwargs: Any - ) -> _models.RegionConfigurationResponse: - """This API provides configuration details specific to given region/location. - - :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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2019-09-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_configuration.py deleted file mode 100644 index dfc863c6f294..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2020-04-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2020-04-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_data_box_management_client.py deleted file mode 100644 index 5cf52ec91103..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_data_box_management_client.py +++ /dev/null @@ -1,97 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2020_04_01.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2020_04_01.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2020_04_01.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2020-04-01". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_metadata.json deleted file mode 100644 index 53be2293b1ae..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_metadata.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "chosen_version": "2020-04-01", - "total_api_version_list": ["2020-04-01"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_vendor.py deleted file mode 100644 index bd0df84f5319..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_vendor.py +++ /dev/null @@ -1,30 +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 typing import List, cast - -from azure.core.pipeline.transport import HttpRequest - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_configuration.py deleted file mode 100644 index 0ba4c6f3e1e2..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2020-04-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2020-04-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_data_box_management_client.py deleted file mode 100644 index cf68687a0459..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_data_box_management_client.py +++ /dev/null @@ -1,97 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2020_04_01.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2020_04_01.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2020_04_01.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2020-04-01". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/__init__.py deleted file mode 100644 index 351b58b163ad..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/__init__.py +++ /dev/null @@ -1,23 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_jobs_operations.py deleted file mode 100644 index eef4cd4a9d9e..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1278 +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 typing import Any, AsyncIterable, 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, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import 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 ..._vendor import _convert_request -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_update_request, -) - -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.v2020_04_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.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", "2020-04-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.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", "2020-04-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-04-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2020-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_04_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_04_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_04_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2020_04_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_04_01.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", "2020-04-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2020-04-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2020-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_04_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_04_01.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, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_04_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2020_04_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_04_01.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", "2020-04-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_04_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2020_04_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-04-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - 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.v2020_04_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2020_04_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-04-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.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", "2020-04-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/__init__.py deleted file mode 100644 index b7a132f52558..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/__init__.py +++ /dev/null @@ -1,257 +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 ._models_py3 import AccountCredentialDetails -from ._models_py3 import AdditionalErrorInfo -from ._models_py3 import AddressValidationOutput -from ._models_py3 import AddressValidationProperties -from ._models_py3 import ApiError -from ._models_py3 import ApplianceNetworkConfiguration -from ._models_py3 import ArmBaseObject -from ._models_py3 import AvailableSkuRequest -from ._models_py3 import AvailableSkusResult -from ._models_py3 import AzureFileFilterDetails -from ._models_py3 import BlobFilterDetails -from ._models_py3 import CancellationReason -from ._models_py3 import CloudError -from ._models_py3 import ContactDetails -from ._models_py3 import CopyLogDetails -from ._models_py3 import CopyProgress -from ._models_py3 import CreateJobValidations -from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest -from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties -from ._models_py3 import DataAccountDetails -from ._models_py3 import DataBoxAccountCopyLogDetails -from ._models_py3 import DataBoxDiskCopyLogDetails -from ._models_py3 import DataBoxDiskCopyProgress -from ._models_py3 import DataBoxDiskJobDetails -from ._models_py3 import DataBoxDiskJobSecrets -from ._models_py3 import DataBoxHeavyAccountCopyLogDetails -from ._models_py3 import DataBoxHeavyJobDetails -from ._models_py3 import DataBoxHeavyJobSecrets -from ._models_py3 import DataBoxHeavySecret -from ._models_py3 import DataBoxJobDetails -from ._models_py3 import DataBoxScheduleAvailabilityRequest -from ._models_py3 import DataBoxSecret -from ._models_py3 import DataExportDetails -from ._models_py3 import DataImportDetails -from ._models_py3 import DataLocationToServiceLocationMap -from ._models_py3 import DataTransferDetailsValidationRequest -from ._models_py3 import DataTransferDetailsValidationResponseProperties -from ._models_py3 import DataboxJobSecrets -from ._models_py3 import DcAccessSecurityCode -from ._models_py3 import Details -from ._models_py3 import DiskScheduleAvailabilityRequest -from ._models_py3 import DiskSecret -from ._models_py3 import ErrorDetail -from ._models_py3 import FilterFileDetails -from ._models_py3 import HeavyScheduleAvailabilityRequest -from ._models_py3 import JobDeliveryInfo -from ._models_py3 import JobDetails -from ._models_py3 import JobResource -from ._models_py3 import JobResourceList -from ._models_py3 import JobResourceUpdateParameter -from ._models_py3 import JobSecrets -from ._models_py3 import JobStages -from ._models_py3 import KeyEncryptionKey -from ._models_py3 import ManagedDiskDetails -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import PackageShippingDetails -from ._models_py3 import Preferences -from ._models_py3 import PreferencesValidationRequest -from ._models_py3 import PreferencesValidationResponseProperties -from ._models_py3 import RegionConfigurationRequest -from ._models_py3 import RegionConfigurationResponse -from ._models_py3 import Resource -from ._models_py3 import ResourceIdentity -from ._models_py3 import ScheduleAvailabilityRequest -from ._models_py3 import ScheduleAvailabilityResponse -from ._models_py3 import ShareCredentialDetails -from ._models_py3 import ShipmentPickUpRequest -from ._models_py3 import ShipmentPickUpResponse -from ._models_py3 import ShippingAddress -from ._models_py3 import Sku -from ._models_py3 import SkuAvailabilityValidationRequest -from ._models_py3 import SkuAvailabilityValidationResponseProperties -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuInformation -from ._models_py3 import StorageAccountDetails -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties -from ._models_py3 import TransferAllDetails -from ._models_py3 import TransferConfiguration -from ._models_py3 import TransferConfigurationTransferAllDetails -from ._models_py3 import TransferConfigurationTransferFilterDetails -from ._models_py3 import TransferFilterDetails -from ._models_py3 import TransportAvailabilityDetails -from ._models_py3 import TransportAvailabilityRequest -from ._models_py3 import TransportAvailabilityResponse -from ._models_py3 import TransportPreferences -from ._models_py3 import UnencryptedCredentials -from ._models_py3 import UnencryptedCredentialsList -from ._models_py3 import UpdateJobDetails -from ._models_py3 import ValidateAddress -from ._models_py3 import ValidationInputRequest -from ._models_py3 import ValidationInputResponse -from ._models_py3 import ValidationRequest -from ._models_py3 import ValidationResponse - -from ._data_box_management_client_enums import AccessProtocol -from ._data_box_management_client_enums import AddressType -from ._data_box_management_client_enums import AddressValidationStatus -from ._data_box_management_client_enums import ClassDiscriminator -from ._data_box_management_client_enums import CopyStatus -from ._data_box_management_client_enums import DataAccountType -from ._data_box_management_client_enums import FilterFileType -from ._data_box_management_client_enums import JobDeliveryType -from ._data_box_management_client_enums import KekType -from ._data_box_management_client_enums import LogCollectionLevel -from ._data_box_management_client_enums import NotificationStageName -from ._data_box_management_client_enums import OverallValidationStatus -from ._data_box_management_client_enums import ShareDestinationFormatType -from ._data_box_management_client_enums import SkuDisabledReason -from ._data_box_management_client_enums import SkuName -from ._data_box_management_client_enums import StageName -from ._data_box_management_client_enums import StageStatus -from ._data_box_management_client_enums import TransferConfigurationType -from ._data_box_management_client_enums import TransferType -from ._data_box_management_client_enums import TransportShipmentTypes -from ._data_box_management_client_enums import ValidationInputDiscriminator -from ._data_box_management_client_enums import ValidationStatus -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccountCredentialDetails", - "AdditionalErrorInfo", - "AddressValidationOutput", - "AddressValidationProperties", - "ApiError", - "ApplianceNetworkConfiguration", - "ArmBaseObject", - "AvailableSkuRequest", - "AvailableSkusResult", - "AzureFileFilterDetails", - "BlobFilterDetails", - "CancellationReason", - "CloudError", - "ContactDetails", - "CopyLogDetails", - "CopyProgress", - "CreateJobValidations", - "CreateOrderLimitForSubscriptionValidationRequest", - "CreateOrderLimitForSubscriptionValidationResponseProperties", - "DataAccountDetails", - "DataBoxAccountCopyLogDetails", - "DataBoxDiskCopyLogDetails", - "DataBoxDiskCopyProgress", - "DataBoxDiskJobDetails", - "DataBoxDiskJobSecrets", - "DataBoxHeavyAccountCopyLogDetails", - "DataBoxHeavyJobDetails", - "DataBoxHeavyJobSecrets", - "DataBoxHeavySecret", - "DataBoxJobDetails", - "DataBoxScheduleAvailabilityRequest", - "DataBoxSecret", - "DataExportDetails", - "DataImportDetails", - "DataLocationToServiceLocationMap", - "DataTransferDetailsValidationRequest", - "DataTransferDetailsValidationResponseProperties", - "DataboxJobSecrets", - "DcAccessSecurityCode", - "Details", - "DiskScheduleAvailabilityRequest", - "DiskSecret", - "ErrorDetail", - "FilterFileDetails", - "HeavyScheduleAvailabilityRequest", - "JobDeliveryInfo", - "JobDetails", - "JobResource", - "JobResourceList", - "JobResourceUpdateParameter", - "JobSecrets", - "JobStages", - "KeyEncryptionKey", - "ManagedDiskDetails", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationList", - "PackageShippingDetails", - "Preferences", - "PreferencesValidationRequest", - "PreferencesValidationResponseProperties", - "RegionConfigurationRequest", - "RegionConfigurationResponse", - "Resource", - "ResourceIdentity", - "ScheduleAvailabilityRequest", - "ScheduleAvailabilityResponse", - "ShareCredentialDetails", - "ShipmentPickUpRequest", - "ShipmentPickUpResponse", - "ShippingAddress", - "Sku", - "SkuAvailabilityValidationRequest", - "SkuAvailabilityValidationResponseProperties", - "SkuCapacity", - "SkuCost", - "SkuInformation", - "StorageAccountDetails", - "SubscriptionIsAllowedToCreateJobValidationRequest", - "SubscriptionIsAllowedToCreateJobValidationResponseProperties", - "TransferAllDetails", - "TransferConfiguration", - "TransferConfigurationTransferAllDetails", - "TransferConfigurationTransferFilterDetails", - "TransferFilterDetails", - "TransportAvailabilityDetails", - "TransportAvailabilityRequest", - "TransportAvailabilityResponse", - "TransportPreferences", - "UnencryptedCredentials", - "UnencryptedCredentialsList", - "UpdateJobDetails", - "ValidateAddress", - "ValidationInputRequest", - "ValidationInputResponse", - "ValidationRequest", - "ValidationResponse", - "AccessProtocol", - "AddressType", - "AddressValidationStatus", - "ClassDiscriminator", - "CopyStatus", - "DataAccountType", - "FilterFileType", - "JobDeliveryType", - "KekType", - "LogCollectionLevel", - "NotificationStageName", - "OverallValidationStatus", - "ShareDestinationFormatType", - "SkuDisabledReason", - "SkuName", - "StageName", - "StageStatus", - "TransferConfigurationType", - "TransferType", - "TransportShipmentTypes", - "ValidationInputDiscriminator", - "ValidationStatus", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_data_box_management_client_enums.py deleted file mode 100644 index 79b22def5c57..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_data_box_management_client_enums.py +++ /dev/null @@ -1,313 +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 enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" - - SMB = "SMB" - """Server Message Block protocol(SMB).""" - NFS = "NFS" - """Network File System protocol(NFS).""" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The address validation status.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the type of job details.""" - - DATA_BOX = "DataBox" - """Data Box orders.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk orders.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy orders.""" - - -class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Status of the copy.""" - - NOT_STARTED = "NotStarted" - """Data copy hasn't started yet.""" - IN_PROGRESS = "InProgress" - """Data copy is in progress.""" - COMPLETED = "Completed" - """Data copy completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Data copy completed with errors.""" - FAILED = "Failed" - """Data copy failed. No data was copied.""" - NOT_RETURNED = "NotReturned" - """No copy triggered as device was not returned.""" - HARDWARE_ERROR = "HardwareError" - """The Device has hit hardware issues.""" - DEVICE_FORMATTED = "DeviceFormatted" - """Data copy failed. The Device was formatted by user.""" - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" - """Data copy failed. Device metadata was modified by user.""" - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" - """Data copy failed. Storage Account was not accessible during copy.""" - UNSUPPORTED_DATA = "UnsupportedData" - """Data copy failed. The Device data content is not supported.""" - - -class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the account.""" - - STORAGE_ACCOUNT = "StorageAccount" - """Storage Accounts .""" - MANAGED_DISK = "ManagedDisk" - """Azure Managed disk storage.""" - - -class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the filter file.""" - - AZURE_BLOB = "AzureBlob" - """Filter file is of the type AzureBlob.""" - AZURE_FILE = "AzureFile" - """Filter file is of the type AzureFiles.""" - - -class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Delivery type of Job.""" - - NON_SCHEDULED = "NonScheduled" - """Non Scheduled job.""" - SCHEDULED = "Scheduled" - """Scheduled job.""" - - -class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of encryption key used for key encryption.""" - - MICROSOFT_MANAGED = "MicrosoftManaged" - """Key encryption key is managed by Microsoft.""" - CUSTOMER_MANAGED = "CustomerManaged" - """Key encryption key is managed by the Customer.""" - - -class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of the logs to be collected.""" - - ERROR = "Error" - """Only Errors will be collected in the logs.""" - VERBOSE = "Verbose" - """Verbose logging (includes Errors, CRC, size information and others).""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - DEVICE_PREPARED = "DevicePrepared" - """Notification at device prepared stage.""" - DISPATCHED = "Dispatched" - """Notification at device dispatched stage.""" - DELIVERED = "Delivered" - """Notification at device delivered stage.""" - PICKED_UP = "PickedUp" - """Notification at device picked up from user stage.""" - AT_AZURE_DC = "AtAzureDC" - """Notification at device received at Azure datacenter stage.""" - DATA_COPY = "DataCopy" - """Notification at data copy started stage.""" - - -class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall validation status.""" - - ALL_VALID_TO_PROCEED = "AllValidToProceed" - """Every input request is valid.""" - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" - """Some input requests are not valid.""" - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" - """Certain input validations skipped.""" - - -class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the share.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown format.""" - HCS = "HCS" - """Storsimple data format.""" - BLOCK_BLOB = "BlockBlob" - """Azure storage block blob format.""" - PAGE_BLOB = "PageBlob" - """Azure storage page blob format.""" - AZURE_FILE = "AzureFile" - """Azure storage file format.""" - MANAGED_DISK = "ManagedDisk" - """Azure Compute Disk.""" - - -class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the Sku is disabled.""" - - NONE = "None" - """SKU is not disabled.""" - COUNTRY = "Country" - """SKU is not available in the requested country.""" - REGION = "Region" - """SKU is not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled for the SKU.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types for the SKU.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" - - DATA_BOX = "DataBox" - """Data Box.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy.""" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage which is in progress.""" - - DEVICE_ORDERED = "DeviceOrdered" - """An order has been created.""" - DEVICE_PREPARED = "DevicePrepared" - """A device has been prepared for the order.""" - DISPATCHED = "Dispatched" - """Device has been dispatched to the user of the order.""" - DELIVERED = "Delivered" - """Device has been delivered to the user of the order.""" - PICKED_UP = "PickedUp" - """Device has been picked up from user and in transit to Azure datacenter.""" - AT_AZURE_DC = "AtAzureDC" - """Device has been received at Azure datacenter from the user.""" - DATA_COPY = "DataCopy" - """Data copy from the device at Azure datacenter.""" - COMPLETED = "Completed" - """Order has completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Order has completed with errors.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" - """Order has failed due to issue reported by user.""" - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" - """Order has failed due to issue detected at Azure datacenter.""" - ABORTED = "Aborted" - """Order has been aborted.""" - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - """Order has completed with warnings.""" - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" - """Device is ready to be handed to customer from Azure DC.""" - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" - """Device can be dropped off at Azure DC.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the job stage.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" - """Stage has succeeded with errors.""" - WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" - """Stage is stuck until customer takes some action.""" - SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" - """Stage has succeeded with warnings.""" - - -class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the configuration for transfer.""" - - TRANSFER_ALL = "TransferAll" - """Transfer all the data.""" - TRANSFER_USING_FILTER = "TransferUsingFilter" - """Transfer using filter.""" - - -class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the transfer.""" - - IMPORT_TO_AZURE = "ImportToAzure" - """Import data to azure.""" - EXPORT_FROM_AZURE = "ExportFromAzure" - """Export data from azure.""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Transport Shipment Type supported for given region.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Identifies the type of validation request.""" - - VALIDATE_ADDRESS = "ValidateAddress" - """Identify request and response of address validation.""" - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" - """Identify request and response for validation of subscription permission to create job.""" - VALIDATE_PREFERENCES = "ValidatePreferences" - """Identify request and response of preference validation.""" - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" - """Identify request and response of create order limit for subscription validation.""" - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" - """Identify request and response of active job limit for sku availability.""" - VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" - """Identify request and response of data transfer details validation.""" - - -class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Create order limit validation status.""" - - VALID = "Valid" - """Validation is successful""" - INVALID = "Invalid" - """Validation is not successful""" - SKIPPED = "Skipped" - """Validation is skipped""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models_py3.py deleted file mode 100644 index d7f844b69d7e..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models_py3.py +++ /dev/null @@ -1,4564 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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, 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 # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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.v2020_04_01.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.v2020_04_01.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): - """Additional error info. - - :ivar type: Additional error type. - :vartype type: str - :ivar info: Additional error info. - :vartype info: JSON - """ - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, *, type: Optional[str] = None, info: Optional[JSON] = None, **kwargs: Any) -> None: - """ - :keyword type: Additional error type. - :paramtype type: str - :keyword info: Additional error info. - :paramtype info: JSON - """ - super().__init__(**kwargs) - self.type = type - self.info = info - - -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.v2020_04_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2020_04_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2020_04_01.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 Azure. - - :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.v2020_04_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_04_01.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 Azure. - - :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.v2020_04_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2020_04_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2020_04_01.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 Azure. - - :ivar error: Required. - :vartype error: ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.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 Azure. - - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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 Azure. - - :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): - """Cloud error. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Cloud error code. - :vartype code: str - :ivar message: Cloud error message. - :vartype message: str - :ivar target: Cloud error target. - :vartype target: str - :ivar details: Cloud error details. - :vartype details: list[~azure.mgmt.databox.v2020_04_01.models.CloudError] - :ivar additional_info: Cloud error additional info. - :vartype additional_info: list[~azure.mgmt.databox.v2020_04_01.models.AdditionalErrorInfo] - """ - - _validation = { - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[CloudError]"}, - "additional_info": {"key": "additionalInfo", "type": "[AdditionalErrorInfo]"}, - } - - def __init__( - self, *, code: Optional[str] = None, message: Optional[str] = None, target: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword code: Cloud error code. - :paramtype code: str - :keyword message: Cloud error message. - :paramtype message: str - :keyword target: Cloud error target. - :paramtype target: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = None - self.additional_info = None - - -class ContactDetails(_serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.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.v2020_04_01.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 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, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails - - All required parameters must be populated in order to send to Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2020_04_01.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", - "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): # pylint: disable=too-many-instance-attributes - """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.v2020_04_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2020_04_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -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 Azure. - - :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.v2020_04_01.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.v2020_04_01.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 Azure. - - :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.v2020_04_01.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.v2020_04_01.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 Azure. - - :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.v2020_04_01.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): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - } - - def __init__(self, *, device_type: Union[str, "_models.SkuName"], **kwargs: Any) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.device_type = device_type - - -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError - :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2020_04_01.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 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 Azure. - - :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.v2020_04_01.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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2020_04_01.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 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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2020_04_01.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", and - "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.v2020_04_01.models.CopyStatus - """ - - _validation = { - "serial_number": {"readonly": True}, - "bytes_copied": {"readonly": True}, - "percent_complete": {"readonly": True}, - "status": {"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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Job details. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DataBoxJobDetails, 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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2020_04_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2020_04_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.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 - """ - - _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}, - "key_encryption_key": {"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"}, - "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"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - } - - _subtype_map = { - "job_details_type": { - "DataBox": "DataBoxJobDetails", - "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, - 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.v2020_04_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences - :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.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = None - self.key_encryption_key = None - self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes - - -class DataBoxDiskJobDetails(JobDetails): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2020_04_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2020_04_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.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 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.v2020_04_01.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :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}, - "key_encryption_key": {"readonly": True}, - "copy_progress": {"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"}, - "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"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "preferred_disks": {"key": "preferredDisks", "type": "{int}"}, - "copy_progress": {"key": "copyProgress", "type": "[DataBoxDiskCopyProgress]"}, - "disks_and_size_details": {"key": "disksAndSizeDetails", "type": "{int}"}, - "passkey": {"key": "passkey", "type": "str"}, - } - - def __init__( - self, - *, - contact_details: "_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, - 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.v2020_04_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences - :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, - 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.disks_and_size_details = None - self.passkey = passkey - - -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, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_04_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2020_04_01.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", - "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 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_04_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2020_04_01.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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2020_04_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2020_04_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2020_04_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.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 copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.v2020_04_01.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}, - "key_encryption_key": {"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"}, - "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"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "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, - 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.v2020_04_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences - :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, - 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_04_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2020_04_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2020_04_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.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 copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.v2020_04_01.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}, - "key_encryption_key": {"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"}, - "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"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "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, - 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.v2020_04_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences - :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, - 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_04_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - _subtype_map = { - "sku_name": { - "DataBox": "DataBoxScheduleAvailabilityRequest", - "DataBoxDisk": "DiskScheduleAvailabilityRequest", - "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", - } - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name: Optional[str] = None - self.country = country - - -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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2020_04_01.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.v2020_04_01.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 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 Azure. - - :ivar transfer_configuration: Configuration for the data transfer. Required. - :vartype transfer_configuration: ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.models.LogCollectionLevel - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2020_04_01.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: Union[str, "_models.LogCollectionLevel"] = "Error", - **kwargs: Any - ) -> None: - """ - :keyword transfer_configuration: Configuration for the data transfer. Required. - :paramtype transfer_configuration: ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.models.LogCollectionLevel - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2020_04_01.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 Azure. - - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2020_04_01.models.DataAccountDetails - """ - - _validation = { - "account_details": {"required": True}, - } - - _attribute_map = { - "account_details": {"key": "accountDetails", "type": "DataAccountDetails"}, - } - - def __init__(self, *, account_details: "_models.DataAccountDetails", **kwargs: Any) -> None: - """ - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2020_04_01.models.DataAccountDetails - """ - super().__init__(**kwargs) - self.account_details = account_details - - -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 Azure. - - :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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.models.DataImportDetails] - :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransferType - """ - - _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"}, - } - - 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, - **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.v2020_04_01.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.v2020_04_01.models.DataImportDetails] - :keyword device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransferType - """ - 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 - - -class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): - """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 Azure. - - :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.v2020_04_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError - :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", - and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2020_04_01.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 Azure. - - :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 DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling disk orders. - - All required parameters must be populated in order to send to Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :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"}, - "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, - **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 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, **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 ErrorDetail(_serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to Azure. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar details: - :vartype details: list[~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.models.Details] - :keyword target: - :paramtype target: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.details = details - self.target = target - - -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 Azure. - - :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.v2020_04_01.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.v2020_04_01.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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **kwargs) - self.sku_name: str = "DataBoxHeavy" - - -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 Azure. - - :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.v2020_04_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2020_04_01.models.ResourceIdentity - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - self.identity = identity - - -class JobResource(Resource): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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.v2020_04_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2020_04_01.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 transfer_type: Type of the data transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.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 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", and "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.models.CloudError - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.models.JobDeliveryType - :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.v2020_04_01.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: bool - """ - - _validation = { - "location": {"required": True}, - "sku": {"required": True}, - "name": {"readonly": True}, - "id": {"readonly": True}, - "type": {"readonly": True}, - "transfer_type": {"required": True}, - "is_cancellable": {"readonly": True}, - "is_deletable": {"readonly": True}, - "is_shipping_address_editable": {"readonly": True}, - "is_prepare_to_ship_enabled": {"readonly": True}, - "status": {"readonly": True}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "is_cancellable_without_fee": {"readonly": True}, - } - - _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"}, - "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"}, - "is_prepare_to_ship_enabled": {"key": "properties.isPrepareToShipEnabled", "type": "bool"}, - "status": {"key": "properties.status", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "error": {"key": "properties.error", "type": "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"}, - } - - def __init__( - 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.v2020_04_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.models.TransferType - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.v2020_04_01.models.JobDetails - :keyword delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :paramtype delivery_type: str or ~azure.mgmt.databox.v2020_04_01.models.JobDeliveryType - :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.v2020_04_01.models.JobDeliveryInfo - """ - super().__init__(location=location, tags=tags, sku=sku, identity=identity, **kwargs) - self.name = None - self.id = None - self.type = None - self.transfer_type = transfer_type - self.is_cancellable = None - self.is_deletable = None - self.is_shipping_address_editable = None - self.is_prepare_to_ship_enabled = None - self.status = None - self.start_time = None - self.error = None - self.details = details - self.cancellation_reason = None - self.delivery_type = delivery_type - self.delivery_info = delivery_info - self.is_cancellable_without_fee = None - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.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.v2020_04_01.models.ResourceIdentity - :ivar details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.models.ResourceIdentity - :keyword details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2020_04_01.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", and "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.v2020_04_01.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", and "SucceededWithWarnings". - :vartype stage_status: str or ~azure.mgmt.databox.v2020_04_01.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 - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"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"}, - } - - 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 - - -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 Azure. - - :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.v2020_04_01.models.KekType - :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"}, - "kek_url": {"key": "kekUrl", "type": "str"}, - "kek_vault_resource_id": {"key": "kekVaultResourceID", "type": "str"}, - } - - def __init__( - self, - *, - kek_type: Union[str, "_models.KekType"] = "MicrosoftManaged", - 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.v2020_04_01.models.KekType - :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.kek_url = kek_url - self.kek_vault_resource_id = kek_vault_resource_id - - -class ManagedDiskDetails(DataAccountDetails): - """Details of the managed disks. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.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 NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :ivar stage_name: Name of the stage. Required. Known values are: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", and "DataCopy". - :vartype stage_name: str or ~azure.mgmt.databox.v2020_04_01.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", and "DataCopy". - :paramtype stage_name: str or ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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 PackageShippingDetails(_serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar tracking_id: Tracking Id of shipment. - :vartype tracking_id: str - :ivar tracking_url: Url where shipment can be tracked. - :vartype tracking_url: str - """ - - _validation = { - "carrier_name": {"readonly": True}, - "tracking_id": {"readonly": True}, - "tracking_url": {"readonly": True}, - } - - _attribute_map = { - "carrier_name": {"key": "carrierName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - "tracking_url": {"key": "trackingUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = 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.v2020_04_01.models.TransportPreferences - """ - - _attribute_map = { - "preferred_data_center_region": {"key": "preferredDataCenterRegion", "type": "[str]"}, - "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, - } - - def __init__( - self, - *, - preferred_data_center_region: Optional[List[str]] = None, - transport_preferences: Optional["_models.TransportPreferences"] = 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.v2020_04_01.models.TransportPreferences - """ - super().__init__(**kwargs) - self.preferred_data_center_region = preferred_data_center_region - self.transport_preferences = transport_preferences - - -class PreferencesValidationRequest(ValidationInputRequest): - """Request to validate preference of transport and data center. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.models.ValidationInputDiscriminator - :ivar preference: Preference of transport and data center. - :vartype preference: ~azure.mgmt.databox.v2020_04_01.models.Preferences - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - preference: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: Preference of transport and data center. - :paramtype preference: ~azure.mgmt.databox.v2020_04_01.models.Preferences - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.preference = preference - self.device_type = device_type - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.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.v2020_04_01.models.ScheduleAvailabilityRequest - :ivar transport_availability_request: Request body to get the transport availability for given - sku. - :vartype transport_availability_request: - ~azure.mgmt.databox.v2020_04_01.models.TransportAvailabilityRequest - """ - - _attribute_map = { - "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, - "transport_availability_request": { - "key": "transportAvailabilityRequest", - "type": "TransportAvailabilityRequest", - }, - } - - def __init__( - self, - *, - schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_availability_request: Request body to get the availability for scheduling - orders. - :paramtype schedule_availability_request: - ~azure.mgmt.databox.v2020_04_01.models.ScheduleAvailabilityRequest - :keyword transport_availability_request: Request body to get the transport availability for - given sku. - :paramtype transport_availability_request: - ~azure.mgmt.databox.v2020_04_01.models.TransportAvailabilityRequest - """ - super().__init__(**kwargs) - self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_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.v2020_04_01.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.v2020_04_01.models.TransportAvailabilityResponse - """ - - _validation = { - "schedule_availability_response": {"readonly": True}, - "transport_availability_response": {"readonly": True}, - } - - _attribute_map = { - "schedule_availability_response": { - "key": "scheduleAvailabilityResponse", - "type": "ScheduleAvailabilityResponse", - }, - "transport_availability_response": { - "key": "transportAvailabilityResponse", - "type": "TransportAvailabilityResponse", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_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 - """ - - _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"}, - } - - def __init__(self, *, type: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword type: Identity type. - :paramtype type: str - """ - super().__init__(**kwargs) - self.type = type - self.principal_id = None - self.tenant_id = 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.v2020_04_01.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.v2020_04_01.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 Azure. - - :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 Azure. - - :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. Required. - :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.v2020_04_01.models.AddressType - """ - - _validation = { - "street_address1": {"required": True}, - "country": {"required": True}, - "postal_code": {"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"}, - } - - def __init__( - self, - *, - street_address1: str, - country: str, - postal_code: str, - street_address2: Optional[str] = None, - street_address3: Optional[str] = None, - city: Optional[str] = None, - state_or_province: Optional[str] = None, - zip_extended_code: Optional[str] = None, - company_name: Optional[str] = None, - address_type: Union[str, "_models.AddressType"] = "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. Required. - :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.v2020_04_01.models.AddressType - """ - 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 - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :vartype name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.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 - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - transfer_type: Union[str, "_models.TransferType"], - country: str, - location: str, - **kwargs: Any - ) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.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 - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.device_type = device_type - self.transfer_type = transfer_type - self.country = country - self.location = location - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError - :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2020_04_01.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 - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = 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.v2020_04_01.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.v2020_04_01.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2020_04_01.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -class StorageAccountDetails(DataAccountDetails): - """Details for the storage account. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.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): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.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): - """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 Azure. - - :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.v2020_04_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.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 TransferAllDetails(_serialization.Model): - """Details to transfer all data. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.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.v2020_04_01.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 Azure. - - :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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.models.TransferAllDetails - """ - super().__init__(**kwargs) - self.include = include - - -class TransferConfigurationTransferFilterDetails(_serialization.Model): - """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.v2020_04_01.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.v2020_04_01.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 Azure. - - :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.v2020_04_01.models.DataAccountType - :ivar blob_filter_details: Filter details to transfer blobs. - :vartype blob_filter_details: ~azure.mgmt.databox.v2020_04_01.models.BlobFilterDetails - :ivar azure_file_filter_details: Filter details to transfer Azure files. - :vartype azure_file_filter_details: - ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.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.v2020_04_01.models.DataAccountType - :keyword blob_filter_details: Filter details to transfer blobs. - :paramtype blob_filter_details: ~azure.mgmt.databox.v2020_04_01.models.BlobFilterDetails - :keyword azure_file_filter_details: Filter details to transfer Azure files. - :paramtype azure_file_filter_details: - ~azure.mgmt.databox.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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", and - "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = None, **kwargs: Any) -> None: - """ - :keyword sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - - -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.v2020_04_01.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. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_04_01.models.TransportShipmentTypes - """ - - _validation = { - "preferred_shipment_type": {"required": True}, - } - - _attribute_map = { - "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, - } - - 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.v2020_04_01.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type - - -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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.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.v2020_04_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :ivar key_encryption_key: Key encryption key for the job. - :vartype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.models.KeyEncryptionKey - """ - - _attribute_map = { - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - } - - def __init__( - self, - *, - contact_details: Optional["_models.ContactDetails"] = None, - shipping_address: Optional["_models.ShippingAddress"] = None, - key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. - :paramtype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :keyword key_encryption_key: Key encryption key for the job. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.models.KeyEncryptionKey - """ - super().__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address - self.key_encryption_key = key_encryption_key - - -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 Azure. - - :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.v2020_04_01.models.ValidationInputDiscriminator - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: ~azure.mgmt.databox.v2020_04_01.models.TransportPreferences - """ - - _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"}, - } - - def __init__( - self, - *, - shipping_address: "_models.ShippingAddress", - device_type: Union[str, "_models.SkuName"], - transport_preferences: Optional["_models.TransportPreferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: ~azure.mgmt.databox.v2020_04_01.models.TransportPreferences - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.shipping_address = shipping_address - self.device_type = device_type - self.transport_preferences = transport_preferences - - -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.v2020_04_01.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.v2020_04_01.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/v2020_04_01/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/__init__.py deleted file mode 100644 index 351b58b163ad..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/__init__.py +++ /dev/null @@ -1,23 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_jobs_operations.py deleted file mode 100644 index ba14152b714a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_jobs_operations.py +++ /dev/null @@ -1,1553 +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 typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, 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.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .._vendor import _convert_request, _format_url_section - -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", "2020-04-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 = _format_url_section(_url, **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_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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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.v2020_04_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.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", "2020-04-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.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", "2020-04-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-04-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2020-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_04_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_04_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_04_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2020_04_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_04_01.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", "2020-04-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2020-04-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2020-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_04_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_04_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_04_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2020_04_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_04_01.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", "2020-04-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_04_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2020_04_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-04-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - 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.v2020_04_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2020_04_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-04-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.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", "2020-04-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_operations.py deleted file mode 100644 index 5b9ea9da5eba..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_operations.py +++ /dev/null @@ -1,155 +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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar -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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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 _convert_request - -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(**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", "2020-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2020_04_01.DataBoxManagementClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.models.Operation] - :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", "2020-04-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_service_operations.py deleted file mode 100644 index 8a54dd5c2818..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_service_operations.py +++ /dev/null @@ -1,1083 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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 _convert_request, _format_url_section - -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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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", "2020-04-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 = _format_url_section(_url, **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.v2020_04_01.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.v2020_04_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2020_04_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.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", "2020-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2020_04_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2020_04_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-04-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2020_04_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-04-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2020_04_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-04-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2020_04_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-04-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2020_04_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-04-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_configuration.py deleted file mode 100644 index e9fd1133383c..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2020-11-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2020-11-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_data_box_management_client.py deleted file mode 100644 index f497599a751b..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_data_box_management_client.py +++ /dev/null @@ -1,97 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2020_11_01.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2020_11_01.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2020_11_01.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2020-11-01". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_metadata.json deleted file mode 100644 index 545163a7f5f5..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_metadata.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "chosen_version": "2020-11-01", - "total_api_version_list": ["2020-11-01"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_vendor.py deleted file mode 100644 index bd0df84f5319..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_vendor.py +++ /dev/null @@ -1,30 +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 typing import List, cast - -from azure.core.pipeline.transport import HttpRequest - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_configuration.py deleted file mode 100644 index 16921b722fd5..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2020-11-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2020-11-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_data_box_management_client.py deleted file mode 100644 index 7dde29730a9f..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_data_box_management_client.py +++ /dev/null @@ -1,97 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2020_11_01.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2020_11_01.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2020_11_01.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2020-11-01". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/__init__.py deleted file mode 100644 index 351b58b163ad..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/__init__.py +++ /dev/null @@ -1,23 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_jobs_operations.py deleted file mode 100644 index f2df0c31914a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1278 +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 typing import Any, AsyncIterable, 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, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import 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 ..._vendor import _convert_request -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_update_request, -) - -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.v2020_11_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2020-11-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_11_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_11_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_11_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2020_11_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2020-11-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2020-11-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_11_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_11_01.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, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_11_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2020_11_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_11_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2020_11_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - 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.v2020_11_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2020_11_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_operations.py deleted file mode 100644 index a7a98689f79c..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_operations.py +++ /dev/null @@ -1,134 +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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -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 ..._vendor import _convert_request -from ...operations._operations import build_list_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2020_11_01.aio.DataBoxManagementClient`'s - :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") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.models.Operation] - :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", "2020-11-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_service_operations.py deleted file mode 100644 index c05e68254e8b..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_service_operations.py +++ /dev/null @@ -1,896 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) - -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.v2020_11_01.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.v2020_11_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2020_11_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2020_11_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2020_11_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2020_11_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2020_11_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2020_11_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2020_11_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2020_11_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2020_11_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/__init__.py deleted file mode 100644 index 5c486a79d395..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/__init__.py +++ /dev/null @@ -1,269 +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 ._models_py3 import AccountCredentialDetails -from ._models_py3 import AdditionalErrorInfo -from ._models_py3 import AddressValidationOutput -from ._models_py3 import AddressValidationProperties -from ._models_py3 import ApiError -from ._models_py3 import ApplianceNetworkConfiguration -from ._models_py3 import ArmBaseObject -from ._models_py3 import AvailableSkuRequest -from ._models_py3 import AvailableSkusResult -from ._models_py3 import AzureFileFilterDetails -from ._models_py3 import BlobFilterDetails -from ._models_py3 import CancellationReason -from ._models_py3 import CloudError -from ._models_py3 import ContactDetails -from ._models_py3 import CopyLogDetails -from ._models_py3 import CopyProgress -from ._models_py3 import CreateJobValidations -from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest -from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties -from ._models_py3 import DataAccountDetails -from ._models_py3 import DataBoxAccountCopyLogDetails -from ._models_py3 import DataBoxDiskCopyLogDetails -from ._models_py3 import DataBoxDiskCopyProgress -from ._models_py3 import DataBoxDiskJobDetails -from ._models_py3 import DataBoxDiskJobSecrets -from ._models_py3 import DataBoxHeavyAccountCopyLogDetails -from ._models_py3 import DataBoxHeavyJobDetails -from ._models_py3 import DataBoxHeavyJobSecrets -from ._models_py3 import DataBoxHeavySecret -from ._models_py3 import DataBoxJobDetails -from ._models_py3 import DataBoxScheduleAvailabilityRequest -from ._models_py3 import DataBoxSecret -from ._models_py3 import DataExportDetails -from ._models_py3 import DataImportDetails -from ._models_py3 import DataLocationToServiceLocationMap -from ._models_py3 import DataTransferDetailsValidationRequest -from ._models_py3 import DataTransferDetailsValidationResponseProperties -from ._models_py3 import DataboxJobSecrets -from ._models_py3 import DcAccessSecurityCode -from ._models_py3 import Details -from ._models_py3 import DiskScheduleAvailabilityRequest -from ._models_py3 import DiskSecret -from ._models_py3 import EncryptionPreferences -from ._models_py3 import ErrorDetail -from ._models_py3 import FilterFileDetails -from ._models_py3 import HeavyScheduleAvailabilityRequest -from ._models_py3 import IdentityProperties -from ._models_py3 import JobDeliveryInfo -from ._models_py3 import JobDetails -from ._models_py3 import JobResource -from ._models_py3 import JobResourceList -from ._models_py3 import JobResourceUpdateParameter -from ._models_py3 import JobSecrets -from ._models_py3 import JobStages -from ._models_py3 import KeyEncryptionKey -from ._models_py3 import ManagedDiskDetails -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import PackageShippingDetails -from ._models_py3 import Preferences -from ._models_py3 import PreferencesValidationRequest -from ._models_py3 import PreferencesValidationResponseProperties -from ._models_py3 import RegionConfigurationRequest -from ._models_py3 import RegionConfigurationResponse -from ._models_py3 import Resource -from ._models_py3 import ResourceIdentity -from ._models_py3 import ScheduleAvailabilityRequest -from ._models_py3 import ScheduleAvailabilityResponse -from ._models_py3 import ShareCredentialDetails -from ._models_py3 import ShipmentPickUpRequest -from ._models_py3 import ShipmentPickUpResponse -from ._models_py3 import ShippingAddress -from ._models_py3 import Sku -from ._models_py3 import SkuAvailabilityValidationRequest -from ._models_py3 import SkuAvailabilityValidationResponseProperties -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuInformation -from ._models_py3 import StorageAccountDetails -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties -from ._models_py3 import SystemData -from ._models_py3 import TransferAllDetails -from ._models_py3 import TransferConfiguration -from ._models_py3 import TransferConfigurationTransferAllDetails -from ._models_py3 import TransferConfigurationTransferFilterDetails -from ._models_py3 import TransferFilterDetails -from ._models_py3 import TransportAvailabilityDetails -from ._models_py3 import TransportAvailabilityRequest -from ._models_py3 import TransportAvailabilityResponse -from ._models_py3 import TransportPreferences -from ._models_py3 import UnencryptedCredentials -from ._models_py3 import UnencryptedCredentialsList -from ._models_py3 import UpdateJobDetails -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import UserAssignedProperties -from ._models_py3 import ValidateAddress -from ._models_py3 import ValidationInputRequest -from ._models_py3 import ValidationInputResponse -from ._models_py3 import ValidationRequest -from ._models_py3 import ValidationResponse - -from ._data_box_management_client_enums import AccessProtocol -from ._data_box_management_client_enums import AddressType -from ._data_box_management_client_enums import AddressValidationStatus -from ._data_box_management_client_enums import ClassDiscriminator -from ._data_box_management_client_enums import CopyStatus -from ._data_box_management_client_enums import DataAccountType -from ._data_box_management_client_enums import DoubleEncryption -from ._data_box_management_client_enums import FilterFileType -from ._data_box_management_client_enums import JobDeliveryType -from ._data_box_management_client_enums import KekType -from ._data_box_management_client_enums import LogCollectionLevel -from ._data_box_management_client_enums import NotificationStageName -from ._data_box_management_client_enums import OverallValidationStatus -from ._data_box_management_client_enums import ShareDestinationFormatType -from ._data_box_management_client_enums import SkuDisabledReason -from ._data_box_management_client_enums import SkuName -from ._data_box_management_client_enums import StageName -from ._data_box_management_client_enums import StageStatus -from ._data_box_management_client_enums import TransferConfigurationType -from ._data_box_management_client_enums import TransferType -from ._data_box_management_client_enums import TransportShipmentTypes -from ._data_box_management_client_enums import ValidationInputDiscriminator -from ._data_box_management_client_enums import ValidationStatus -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccountCredentialDetails", - "AdditionalErrorInfo", - "AddressValidationOutput", - "AddressValidationProperties", - "ApiError", - "ApplianceNetworkConfiguration", - "ArmBaseObject", - "AvailableSkuRequest", - "AvailableSkusResult", - "AzureFileFilterDetails", - "BlobFilterDetails", - "CancellationReason", - "CloudError", - "ContactDetails", - "CopyLogDetails", - "CopyProgress", - "CreateJobValidations", - "CreateOrderLimitForSubscriptionValidationRequest", - "CreateOrderLimitForSubscriptionValidationResponseProperties", - "DataAccountDetails", - "DataBoxAccountCopyLogDetails", - "DataBoxDiskCopyLogDetails", - "DataBoxDiskCopyProgress", - "DataBoxDiskJobDetails", - "DataBoxDiskJobSecrets", - "DataBoxHeavyAccountCopyLogDetails", - "DataBoxHeavyJobDetails", - "DataBoxHeavyJobSecrets", - "DataBoxHeavySecret", - "DataBoxJobDetails", - "DataBoxScheduleAvailabilityRequest", - "DataBoxSecret", - "DataExportDetails", - "DataImportDetails", - "DataLocationToServiceLocationMap", - "DataTransferDetailsValidationRequest", - "DataTransferDetailsValidationResponseProperties", - "DataboxJobSecrets", - "DcAccessSecurityCode", - "Details", - "DiskScheduleAvailabilityRequest", - "DiskSecret", - "EncryptionPreferences", - "ErrorDetail", - "FilterFileDetails", - "HeavyScheduleAvailabilityRequest", - "IdentityProperties", - "JobDeliveryInfo", - "JobDetails", - "JobResource", - "JobResourceList", - "JobResourceUpdateParameter", - "JobSecrets", - "JobStages", - "KeyEncryptionKey", - "ManagedDiskDetails", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationList", - "PackageShippingDetails", - "Preferences", - "PreferencesValidationRequest", - "PreferencesValidationResponseProperties", - "RegionConfigurationRequest", - "RegionConfigurationResponse", - "Resource", - "ResourceIdentity", - "ScheduleAvailabilityRequest", - "ScheduleAvailabilityResponse", - "ShareCredentialDetails", - "ShipmentPickUpRequest", - "ShipmentPickUpResponse", - "ShippingAddress", - "Sku", - "SkuAvailabilityValidationRequest", - "SkuAvailabilityValidationResponseProperties", - "SkuCapacity", - "SkuCost", - "SkuInformation", - "StorageAccountDetails", - "SubscriptionIsAllowedToCreateJobValidationRequest", - "SubscriptionIsAllowedToCreateJobValidationResponseProperties", - "SystemData", - "TransferAllDetails", - "TransferConfiguration", - "TransferConfigurationTransferAllDetails", - "TransferConfigurationTransferFilterDetails", - "TransferFilterDetails", - "TransportAvailabilityDetails", - "TransportAvailabilityRequest", - "TransportAvailabilityResponse", - "TransportPreferences", - "UnencryptedCredentials", - "UnencryptedCredentialsList", - "UpdateJobDetails", - "UserAssignedIdentity", - "UserAssignedProperties", - "ValidateAddress", - "ValidationInputRequest", - "ValidationInputResponse", - "ValidationRequest", - "ValidationResponse", - "AccessProtocol", - "AddressType", - "AddressValidationStatus", - "ClassDiscriminator", - "CopyStatus", - "DataAccountType", - "DoubleEncryption", - "FilterFileType", - "JobDeliveryType", - "KekType", - "LogCollectionLevel", - "NotificationStageName", - "OverallValidationStatus", - "ShareDestinationFormatType", - "SkuDisabledReason", - "SkuName", - "StageName", - "StageStatus", - "TransferConfigurationType", - "TransferType", - "TransportShipmentTypes", - "ValidationInputDiscriminator", - "ValidationStatus", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_data_box_management_client_enums.py deleted file mode 100644 index 1159ee94eb7b..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_data_box_management_client_enums.py +++ /dev/null @@ -1,322 +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 enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" - - SMB = "SMB" - """Server Message Block protocol(SMB).""" - NFS = "NFS" - """Network File System protocol(NFS).""" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The address validation status.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the type of job details.""" - - DATA_BOX = "DataBox" - """Data Box orders.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk orders.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy orders.""" - - -class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Status of the copy.""" - - NOT_STARTED = "NotStarted" - """Data copy hasn't started yet.""" - IN_PROGRESS = "InProgress" - """Data copy is in progress.""" - COMPLETED = "Completed" - """Data copy completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Data copy completed with errors.""" - FAILED = "Failed" - """Data copy failed. No data was copied.""" - NOT_RETURNED = "NotReturned" - """No copy triggered as device was not returned.""" - HARDWARE_ERROR = "HardwareError" - """The Device has hit hardware issues.""" - DEVICE_FORMATTED = "DeviceFormatted" - """Data copy failed. The Device was formatted by user.""" - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" - """Data copy failed. Device metadata was modified by user.""" - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" - """Data copy failed. Storage Account was not accessible during copy.""" - UNSUPPORTED_DATA = "UnsupportedData" - """Data copy failed. The Device data content is not supported.""" - - -class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the account.""" - - STORAGE_ACCOUNT = "StorageAccount" - """Storage Accounts .""" - MANAGED_DISK = "ManagedDisk" - """Azure Managed disk storage.""" - - -class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines secondary layer of software-based encryption enablement.""" - - ENABLED = "Enabled" - """Software-based encryption is enabled.""" - DISABLED = "Disabled" - """Software-based encryption is disabled.""" - - -class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the filter file.""" - - AZURE_BLOB = "AzureBlob" - """Filter file is of the type AzureBlob.""" - AZURE_FILE = "AzureFile" - """Filter file is of the type AzureFiles.""" - - -class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Delivery type of Job.""" - - NON_SCHEDULED = "NonScheduled" - """Non Scheduled job.""" - SCHEDULED = "Scheduled" - """Scheduled job.""" - - -class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of encryption key used for key encryption.""" - - MICROSOFT_MANAGED = "MicrosoftManaged" - """Key encryption key is managed by Microsoft.""" - CUSTOMER_MANAGED = "CustomerManaged" - """Key encryption key is managed by the Customer.""" - - -class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of the logs to be collected.""" - - ERROR = "Error" - """Only Errors will be collected in the logs.""" - VERBOSE = "Verbose" - """Verbose logging (includes Errors, CRC, size information and others).""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - DEVICE_PREPARED = "DevicePrepared" - """Notification at device prepared stage.""" - DISPATCHED = "Dispatched" - """Notification at device dispatched stage.""" - DELIVERED = "Delivered" - """Notification at device delivered stage.""" - PICKED_UP = "PickedUp" - """Notification at device picked up from user stage.""" - AT_AZURE_DC = "AtAzureDC" - """Notification at device received at Azure datacenter stage.""" - DATA_COPY = "DataCopy" - """Notification at data copy started stage.""" - - -class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall validation status.""" - - ALL_VALID_TO_PROCEED = "AllValidToProceed" - """Every input request is valid.""" - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" - """Some input requests are not valid.""" - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" - """Certain input validations skipped.""" - - -class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the share.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown format.""" - HCS = "HCS" - """Storsimple data format.""" - BLOCK_BLOB = "BlockBlob" - """Azure storage block blob format.""" - PAGE_BLOB = "PageBlob" - """Azure storage page blob format.""" - AZURE_FILE = "AzureFile" - """Azure storage file format.""" - MANAGED_DISK = "ManagedDisk" - """Azure Compute Disk.""" - - -class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the Sku is disabled.""" - - NONE = "None" - """SKU is not disabled.""" - COUNTRY = "Country" - """SKU is not available in the requested country.""" - REGION = "Region" - """SKU is not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled for the SKU.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types for the SKU.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" - - DATA_BOX = "DataBox" - """Data Box.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy.""" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage which is in progress.""" - - DEVICE_ORDERED = "DeviceOrdered" - """An order has been created.""" - DEVICE_PREPARED = "DevicePrepared" - """A device has been prepared for the order.""" - DISPATCHED = "Dispatched" - """Device has been dispatched to the user of the order.""" - DELIVERED = "Delivered" - """Device has been delivered to the user of the order.""" - PICKED_UP = "PickedUp" - """Device has been picked up from user and in transit to Azure datacenter.""" - AT_AZURE_DC = "AtAzureDC" - """Device has been received at Azure datacenter from the user.""" - DATA_COPY = "DataCopy" - """Data copy from the device at Azure datacenter.""" - COMPLETED = "Completed" - """Order has completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Order has completed with errors.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" - """Order has failed due to issue reported by user.""" - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" - """Order has failed due to issue detected at Azure datacenter.""" - ABORTED = "Aborted" - """Order has been aborted.""" - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - """Order has completed with warnings.""" - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" - """Device is ready to be handed to customer from Azure DC.""" - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" - """Device can be dropped off at Azure DC.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the job stage.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" - """Stage has succeeded with errors.""" - WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" - """Stage is stuck until customer takes some action.""" - SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" - """Stage has succeeded with warnings.""" - - -class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the configuration for transfer.""" - - TRANSFER_ALL = "TransferAll" - """Transfer all the data.""" - TRANSFER_USING_FILTER = "TransferUsingFilter" - """Transfer using filter.""" - - -class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the transfer.""" - - IMPORT_TO_AZURE = "ImportToAzure" - """Import data to azure.""" - EXPORT_FROM_AZURE = "ExportFromAzure" - """Export data from azure.""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Transport Shipment Type supported for given region.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Identifies the type of validation request.""" - - VALIDATE_ADDRESS = "ValidateAddress" - """Identify request and response of address validation.""" - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" - """Identify request and response for validation of subscription permission to create job.""" - VALIDATE_PREFERENCES = "ValidatePreferences" - """Identify request and response of preference validation.""" - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" - """Identify request and response of create order limit for subscription validation.""" - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" - """Identify request and response of active job limit for sku availability.""" - VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" - """Identify request and response of data transfer details validation.""" - - -class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Create order limit validation status.""" - - VALID = "Valid" - """Validation is successful""" - INVALID = "Invalid" - """Validation is not successful""" - SKIPPED = "Skipped" - """Validation is skipped""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models_py3.py deleted file mode 100644 index 46acb78a4fe5..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models_py3.py +++ /dev/null @@ -1,4761 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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, 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 # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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.v2020_11_01.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.v2020_11_01.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): - """Additional error info. - - :ivar type: Additional error type. - :vartype type: str - :ivar info: Additional error info. - :vartype info: JSON - """ - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, *, type: Optional[str] = None, info: Optional[JSON] = None, **kwargs: Any) -> None: - """ - :keyword type: Additional error type. - :paramtype type: str - :keyword info: Additional error info. - :paramtype info: JSON - """ - super().__init__(**kwargs) - self.type = type - self.info = info - - -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.v2020_11_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2020_11_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2020_11_01.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 Azure. - - :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.v2020_11_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_11_01.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 Azure. - - :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.v2020_11_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2020_11_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2020_11_01.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 Azure. - - :ivar error: Required. - :vartype error: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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 Azure. - - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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 Azure. - - :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): - """Cloud error. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Cloud error code. - :vartype code: str - :ivar message: Cloud error message. - :vartype message: str - :ivar target: Cloud error target. - :vartype target: str - :ivar details: Cloud error details. - :vartype details: list[~azure.mgmt.databox.v2020_11_01.models.CloudError] - :ivar additional_info: Cloud error additional info. - :vartype additional_info: list[~azure.mgmt.databox.v2020_11_01.models.AdditionalErrorInfo] - """ - - _validation = { - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[CloudError]"}, - "additional_info": {"key": "additionalInfo", "type": "[AdditionalErrorInfo]"}, - } - - def __init__( - self, *, code: Optional[str] = None, message: Optional[str] = None, target: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword code: Cloud error code. - :paramtype code: str - :keyword message: Cloud error message. - :paramtype message: str - :keyword target: Cloud error target. - :paramtype target: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = None - self.additional_info = None - - -class ContactDetails(_serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_11_01.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.v2020_11_01.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 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, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails - - All required parameters must be populated in order to send to Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2020_11_01.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", - "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): # pylint: disable=too-many-instance-attributes - """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.v2020_11_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2020_11_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -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 Azure. - - :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.v2020_11_01.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.v2020_11_01.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 Azure. - - :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.v2020_11_01.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.v2020_11_01.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 Azure. - - :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.v2020_11_01.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): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_11_01.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - } - - def __init__(self, *, device_type: Union[str, "_models.SkuName"], **kwargs: Any) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.device_type = device_type - - -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_11_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError - :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2020_11_01.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 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 Azure. - - :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.v2020_11_01.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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2020_11_01.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 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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2020_11_01.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", and - "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.v2020_11_01.models.CopyStatus - """ - - _validation = { - "serial_number": {"readonly": True}, - "bytes_copied": {"readonly": True}, - "percent_complete": {"readonly": True}, - "status": {"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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Job details. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DataBoxJobDetails, 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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2020_11_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2020_11_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.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 - """ - - _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}, - } - - _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"}, - "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"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - } - - _subtype_map = { - "job_details_type": { - "DataBox": "DataBoxJobDetails", - "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, - 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.v2020_11_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.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.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = None - self.key_encryption_key = key_encryption_key - self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes - - -class DataBoxDiskJobDetails(JobDetails): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2020_11_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2020_11_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.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 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.v2020_11_01.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :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}, - "copy_progress": {"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"}, - "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"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "preferred_disks": {"key": "preferredDisks", "type": "{int}"}, - "copy_progress": {"key": "copyProgress", "type": "[DataBoxDiskCopyProgress]"}, - "disks_and_size_details": {"key": "disksAndSizeDetails", "type": "{int}"}, - "passkey": {"key": "passkey", "type": "str"}, - } - - def __init__( - self, - *, - contact_details: "_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, - 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.v2020_11_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.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, - 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.disks_and_size_details = None - self.passkey = passkey - - -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, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_11_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2020_11_01.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", - "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 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_11_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2020_11_01.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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2020_11_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2020_11_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2020_11_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.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 copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.v2020_11_01.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}, - "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"}, - "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"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "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, - 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.v2020_11_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.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, - 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_11_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2020_11_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2020_11_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.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 copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.v2020_11_01.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}, - "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"}, - "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"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - "expected_data_size_in_tera_bytes": {"key": "expectedDataSizeInTeraBytes", "type": "int"}, - "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, - 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.v2020_11_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.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, - 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_11_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - _subtype_map = { - "sku_name": { - "DataBox": "DataBoxScheduleAvailabilityRequest", - "DataBoxDisk": "DiskScheduleAvailabilityRequest", - "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", - } - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name: Optional[str] = None - self.country = country - - -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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2020_11_01.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.v2020_11_01.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 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 Azure. - - :ivar transfer_configuration: Configuration for the data transfer. Required. - :vartype transfer_configuration: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.models.LogCollectionLevel - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2020_11_01.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: Union[str, "_models.LogCollectionLevel"] = "Error", - **kwargs: Any - ) -> None: - """ - :keyword transfer_configuration: Configuration for the data transfer. Required. - :paramtype transfer_configuration: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.models.LogCollectionLevel - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2020_11_01.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 Azure. - - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2020_11_01.models.DataAccountDetails - """ - - _validation = { - "account_details": {"required": True}, - } - - _attribute_map = { - "account_details": {"key": "accountDetails", "type": "DataAccountDetails"}, - } - - def __init__(self, *, account_details: "_models.DataAccountDetails", **kwargs: Any) -> None: - """ - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2020_11_01.models.DataAccountDetails - """ - super().__init__(**kwargs) - self.account_details = account_details - - -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 Azure. - - :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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.models.DataImportDetails] - :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransferType - """ - - _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"}, - } - - 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, - **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.v2020_11_01.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.v2020_11_01.models.DataImportDetails] - :keyword device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransferType - """ - 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 - - -class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): - """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 Azure. - - :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.v2020_11_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError - :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", - and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2020_11_01.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 Azure. - - :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 DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling disk orders. - - All required parameters must be populated in order to send to Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :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"}, - "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, - **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 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, **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.v2020_11_01.models.DoubleEncryption - """ - - _attribute_map = { - "double_encryption": {"key": "doubleEncryption", "type": "str"}, - } - - def __init__( - self, *, double_encryption: Union[str, "_models.DoubleEncryption"] = "Disabled", **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.v2020_11_01.models.DoubleEncryption - """ - super().__init__(**kwargs) - self.double_encryption = double_encryption - - -class ErrorDetail(_serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to Azure. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar details: - :vartype details: list[~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.models.Details] - :keyword target: - :paramtype target: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.details = details - self.target = target - - -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 Azure. - - :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.v2020_11_01.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.v2020_11_01.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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2020_11_01.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.v2020_11_01.models.UserAssignedProperties - """ - super().__init__(**kwargs) - self.type = type - self.user_assigned = user_assigned - - -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 Azure. - - :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.v2020_11_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2020_11_01.models.ResourceIdentity - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - self.identity = identity - - -class JobResource(Resource): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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.v2020_11_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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 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", and "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.models.CloudError - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.models.JobDeliveryType - :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.v2020_11_01.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: 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}, - "is_prepare_to_ship_enabled": {"readonly": True}, - "status": {"readonly": True}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "is_cancellable_without_fee": {"readonly": True}, - } - - _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"}, - "is_prepare_to_ship_enabled": {"key": "properties.isPrepareToShipEnabled", "type": "bool"}, - "status": {"key": "properties.status", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "error": {"key": "properties.error", "type": "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"}, - } - - def __init__( - 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.v2020_11_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.models.TransferType - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.v2020_11_01.models.JobDetails - :keyword delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :paramtype delivery_type: str or ~azure.mgmt.databox.v2020_11_01.models.JobDeliveryType - :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.v2020_11_01.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.is_prepare_to_ship_enabled = None - self.status = None - self.start_time = None - self.error = None - self.details = details - self.cancellation_reason = None - self.delivery_type = delivery_type - self.delivery_info = delivery_info - self.is_cancellable_without_fee = None - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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.v2020_11_01.models.ResourceIdentity - :ivar details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.models.ResourceIdentity - :keyword details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2020_11_01.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", and "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.v2020_11_01.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", and "SucceededWithWarnings". - :vartype stage_status: str or ~azure.mgmt.databox.v2020_11_01.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 - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"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"}, - } - - 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 - - -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 Azure. - - :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.v2020_11_01.models.KekType - :ivar identity_properties: Managed identity properties used for key encryption. - :vartype identity_properties: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.models.KekType - :keyword identity_properties: Managed identity properties used for key encryption. - :paramtype identity_properties: ~azure.mgmt.databox.v2020_11_01.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 ManagedDiskDetails(DataAccountDetails): - """Details of the managed disks. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_11_01.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 NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :ivar stage_name: Name of the stage. Required. Known values are: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", and "DataCopy". - :vartype stage_name: str or ~azure.mgmt.databox.v2020_11_01.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", and "DataCopy". - :paramtype stage_name: str or ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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 PackageShippingDetails(_serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar tracking_id: Tracking Id of shipment. - :vartype tracking_id: str - :ivar tracking_url: Url where shipment can be tracked. - :vartype tracking_url: str - """ - - _validation = { - "carrier_name": {"readonly": True}, - "tracking_id": {"readonly": True}, - "tracking_url": {"readonly": True}, - } - - _attribute_map = { - "carrier_name": {"key": "carrierName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - "tracking_url": {"key": "trackingUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = 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.v2020_11_01.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: ~azure.mgmt.databox.v2020_11_01.models.EncryptionPreferences - """ - - _attribute_map = { - "preferred_data_center_region": {"key": "preferredDataCenterRegion", "type": "[str]"}, - "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, - "encryption_preferences": {"key": "encryptionPreferences", "type": "EncryptionPreferences"}, - } - - def __init__( - self, - *, - preferred_data_center_region: Optional[List[str]] = None, - transport_preferences: Optional["_models.TransportPreferences"] = None, - encryption_preferences: Optional["_models.EncryptionPreferences"] = 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.v2020_11_01.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: ~azure.mgmt.databox.v2020_11_01.models.EncryptionPreferences - """ - super().__init__(**kwargs) - self.preferred_data_center_region = preferred_data_center_region - self.transport_preferences = transport_preferences - self.encryption_preferences = encryption_preferences - - -class PreferencesValidationRequest(ValidationInputRequest): - """Request to validate preference of transport and data center. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_11_01.models.ValidationInputDiscriminator - :ivar preference: Preference of transport and data center. - :vartype preference: ~azure.mgmt.databox.v2020_11_01.models.Preferences - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - preference: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: Preference of transport and data center. - :paramtype preference: ~azure.mgmt.databox.v2020_11_01.models.Preferences - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.preference = preference - self.device_type = device_type - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_11_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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.v2020_11_01.models.ScheduleAvailabilityRequest - :ivar transport_availability_request: Request body to get the transport availability for given - sku. - :vartype transport_availability_request: - ~azure.mgmt.databox.v2020_11_01.models.TransportAvailabilityRequest - """ - - _attribute_map = { - "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, - "transport_availability_request": { - "key": "transportAvailabilityRequest", - "type": "TransportAvailabilityRequest", - }, - } - - def __init__( - self, - *, - schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_availability_request: Request body to get the availability for scheduling - orders. - :paramtype schedule_availability_request: - ~azure.mgmt.databox.v2020_11_01.models.ScheduleAvailabilityRequest - :keyword transport_availability_request: Request body to get the transport availability for - given sku. - :paramtype transport_availability_request: - ~azure.mgmt.databox.v2020_11_01.models.TransportAvailabilityRequest - """ - super().__init__(**kwargs) - self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_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.v2020_11_01.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.v2020_11_01.models.TransportAvailabilityResponse - """ - - _validation = { - "schedule_availability_response": {"readonly": True}, - "transport_availability_response": {"readonly": True}, - } - - _attribute_map = { - "schedule_availability_response": { - "key": "scheduleAvailabilityResponse", - "type": "ScheduleAvailabilityResponse", - }, - "transport_availability_response": { - "key": "transportAvailabilityResponse", - "type": "TransportAvailabilityResponse", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_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.v2020_11_01.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.v2020_11_01.models.UserAssignedIdentity] - """ - super().__init__(**kwargs) - self.type = type - self.principal_id = None - self.tenant_id = None - self.user_assigned_identities = user_assigned_identities - - -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.v2020_11_01.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.v2020_11_01.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 Azure. - - :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 Azure. - - :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.v2020_11_01.models.AddressType - """ - - _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"}, - } - - 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", - **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.v2020_11_01.models.AddressType - """ - 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 - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :vartype name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_11_01.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.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 - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - transfer_type: Union[str, "_models.TransferType"], - country: str, - location: str, - **kwargs: Any - ) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.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 - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.device_type = device_type - self.transfer_type = transfer_type - self.country = country - self.location = location - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_11_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError - :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2020_11_01.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 - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = 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.v2020_11_01.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.v2020_11_01.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2020_11_01.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -class StorageAccountDetails(DataAccountDetails): - """Details for the storage account. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_11_01.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): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_11_01.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): - """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 Azure. - - :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.v2020_11_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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 Azure. - - :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.v2020_11_01.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.v2020_11_01.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 Azure. - - :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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.models.TransferAllDetails - """ - super().__init__(**kwargs) - self.include = include - - -class TransferConfigurationTransferFilterDetails(_serialization.Model): - """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.v2020_11_01.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.v2020_11_01.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 Azure. - - :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.v2020_11_01.models.DataAccountType - :ivar blob_filter_details: Filter details to transfer blobs. - :vartype blob_filter_details: ~azure.mgmt.databox.v2020_11_01.models.BlobFilterDetails - :ivar azure_file_filter_details: Filter details to transfer Azure files. - :vartype azure_file_filter_details: - ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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.v2020_11_01.models.DataAccountType - :keyword blob_filter_details: Filter details to transfer blobs. - :paramtype blob_filter_details: ~azure.mgmt.databox.v2020_11_01.models.BlobFilterDetails - :keyword azure_file_filter_details: Filter details to transfer Azure files. - :paramtype azure_file_filter_details: - ~azure.mgmt.databox.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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", and - "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = None, **kwargs: Any) -> None: - """ - :keyword sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - - -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.v2020_11_01.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. - - All required parameters must be populated in order to send to Azure. - - :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.v2020_11_01.models.TransportShipmentTypes - """ - - _validation = { - "preferred_shipment_type": {"required": True}, - } - - _attribute_map = { - "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, - } - - 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.v2020_11_01.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type - - -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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.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.v2020_11_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :ivar key_encryption_key: Key encryption key for the job. - :vartype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey - """ - - _attribute_map = { - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - } - - def __init__( - self, - *, - contact_details: Optional["_models.ContactDetails"] = None, - shipping_address: Optional["_models.ShippingAddress"] = None, - key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. - :paramtype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :keyword key_encryption_key: Key encryption key for the job. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey - """ - super().__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address - self.key_encryption_key = key_encryption_key - - -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 Azure. - - :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.v2020_11_01.models.ValidationInputDiscriminator - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: ~azure.mgmt.databox.v2020_11_01.models.TransportPreferences - """ - - _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"}, - } - - def __init__( - self, - *, - shipping_address: "_models.ShippingAddress", - device_type: Union[str, "_models.SkuName"], - transport_preferences: Optional["_models.TransportPreferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: ~azure.mgmt.databox.v2020_11_01.models.TransportPreferences - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.shipping_address = shipping_address - self.device_type = device_type - self.transport_preferences = transport_preferences - - -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.v2020_11_01.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.v2020_11_01.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/v2020_11_01/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/__init__.py deleted file mode 100644 index 351b58b163ad..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/__init__.py +++ /dev/null @@ -1,23 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_jobs_operations.py deleted file mode 100644 index 7d0e7750608a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_jobs_operations.py +++ /dev/null @@ -1,1553 +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 typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, 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.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .._vendor import _convert_request, _format_url_section - -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", "2020-11-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 = _format_url_section(_url, **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_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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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.v2020_11_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2020-11-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_11_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_11_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_11_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2020_11_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2020-11-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2020-11-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_11_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_11_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_11_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2020_11_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2020_11_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2020_11_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - 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.v2020_11_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2020_11_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_service_operations.py deleted file mode 100644 index 9a3179c2ce5d..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_service_operations.py +++ /dev/null @@ -1,1083 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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 _convert_request, _format_url_section - -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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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", "2020-11-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 = _format_url_section(_url, **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.v2020_11_01.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.v2020_11_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2020_11_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.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", "2020-11-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2020_11_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2020_11_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2020_11_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2020_11_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2020_11_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2020_11_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2020_11_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2020_11_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2020-11-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_configuration.py deleted file mode 100644 index 00854564ad62..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-03-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2021-03-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_data_box_management_client.py deleted file mode 100644 index bcfa59dcd828..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2021_03_01.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2021_03_01.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2021_03_01.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-03-01". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_metadata.json deleted file mode 100644 index 0ae7fe8ee06b..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "chosen_version": "2021-03-01", - "total_api_version_list": ["2021-03-01"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - }, - "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "sync_mixin_typing_definitions": "", - "async_mixin_typing_definitions": "", - "operations": { - "mitigate" : { - "sync": { - "signature": "def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_03_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_03_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - } - } - } - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_vendor.py deleted file mode 100644 index ec8d8f6dd7b4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_vendor.py +++ /dev/null @@ -1,48 +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 List, TYPE_CHECKING, cast - -from azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from .._serialization import Deserializer, Serializer - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - -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/v2021_03_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_configuration.py deleted file mode 100644 index 793a76549e44..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-03-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2021-03-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_data_box_management_client.py deleted file mode 100644 index b4ef1b3148ed..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2021_03_01.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2021_03_01.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2021_03_01.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-03-01". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_jobs_operations.py deleted file mode 100644 index e91ad4ac279f..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1279 +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 typing import Any, AsyncIterable, 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, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import 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 ..._vendor import _convert_request -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_update_request, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2021_03_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_03_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_03_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_03_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2021_03_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2021-03-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_03_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_03_01.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, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_03_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2021_03_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_03_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2021_03_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - 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.v2021_03_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2021_03_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_operations.py deleted file mode 100644 index 4dd8b9d246e0..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_operations.py +++ /dev/null @@ -1,135 +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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -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 ..._vendor import _convert_request -from ...operations._operations import build_list_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2021_03_01.aio.DataBoxManagementClient`'s - :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") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.models.Operation] - :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", "2021-03-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_service_operations.py deleted file mode 100644 index a92d389ee394..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_service_operations.py +++ /dev/null @@ -1,897 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2021_03_01.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.v2021_03_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2021_03_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2021_03_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2021_03_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2021_03_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_03_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_03_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_03_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_03_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2021_03_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/__init__.py deleted file mode 100644 index 52fb28c6d302..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/__init__.py +++ /dev/null @@ -1,275 +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 ._models_py3 import AccountCredentialDetails -from ._models_py3 import AdditionalErrorInfo -from ._models_py3 import AddressValidationOutput -from ._models_py3 import AddressValidationProperties -from ._models_py3 import ApiError -from ._models_py3 import ApplianceNetworkConfiguration -from ._models_py3 import ArmBaseObject -from ._models_py3 import AvailableSkuRequest -from ._models_py3 import AvailableSkusResult -from ._models_py3 import AzureFileFilterDetails -from ._models_py3 import BlobFilterDetails -from ._models_py3 import CancellationReason -from ._models_py3 import CloudError -from ._models_py3 import ContactDetails -from ._models_py3 import CopyLogDetails -from ._models_py3 import CopyProgress -from ._models_py3 import CreateJobValidations -from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest -from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties -from ._models_py3 import DataAccountDetails -from ._models_py3 import DataBoxAccountCopyLogDetails -from ._models_py3 import DataBoxDiskCopyLogDetails -from ._models_py3 import DataBoxDiskCopyProgress -from ._models_py3 import DataBoxDiskJobDetails -from ._models_py3 import DataBoxDiskJobSecrets -from ._models_py3 import DataBoxHeavyAccountCopyLogDetails -from ._models_py3 import DataBoxHeavyJobDetails -from ._models_py3 import DataBoxHeavyJobSecrets -from ._models_py3 import DataBoxHeavySecret -from ._models_py3 import DataBoxJobDetails -from ._models_py3 import DataBoxScheduleAvailabilityRequest -from ._models_py3 import DataBoxSecret -from ._models_py3 import DataExportDetails -from ._models_py3 import DataImportDetails -from ._models_py3 import DataLocationToServiceLocationMap -from ._models_py3 import DataTransferDetailsValidationRequest -from ._models_py3 import DataTransferDetailsValidationResponseProperties -from ._models_py3 import DataboxJobSecrets -from ._models_py3 import DcAccessSecurityCode -from ._models_py3 import Details -from ._models_py3 import DiskScheduleAvailabilityRequest -from ._models_py3 import DiskSecret -from ._models_py3 import EncryptionPreferences -from ._models_py3 import ErrorDetail -from ._models_py3 import FilterFileDetails -from ._models_py3 import HeavyScheduleAvailabilityRequest -from ._models_py3 import IdentityProperties -from ._models_py3 import JobDeliveryInfo -from ._models_py3 import JobDetails -from ._models_py3 import JobResource -from ._models_py3 import JobResourceList -from ._models_py3 import JobResourceUpdateParameter -from ._models_py3 import JobSecrets -from ._models_py3 import JobStages -from ._models_py3 import KeyEncryptionKey -from ._models_py3 import LastMitigationActionOnJob -from ._models_py3 import ManagedDiskDetails -from ._models_py3 import MitigateJobRequest -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import PackageShippingDetails -from ._models_py3 import Preferences -from ._models_py3 import PreferencesValidationRequest -from ._models_py3 import PreferencesValidationResponseProperties -from ._models_py3 import RegionConfigurationRequest -from ._models_py3 import RegionConfigurationResponse -from ._models_py3 import Resource -from ._models_py3 import ResourceIdentity -from ._models_py3 import ScheduleAvailabilityRequest -from ._models_py3 import ScheduleAvailabilityResponse -from ._models_py3 import ShareCredentialDetails -from ._models_py3 import ShipmentPickUpRequest -from ._models_py3 import ShipmentPickUpResponse -from ._models_py3 import ShippingAddress -from ._models_py3 import Sku -from ._models_py3 import SkuAvailabilityValidationRequest -from ._models_py3 import SkuAvailabilityValidationResponseProperties -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuInformation -from ._models_py3 import StorageAccountDetails -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties -from ._models_py3 import SystemData -from ._models_py3 import TransferAllDetails -from ._models_py3 import TransferConfiguration -from ._models_py3 import TransferConfigurationTransferAllDetails -from ._models_py3 import TransferConfigurationTransferFilterDetails -from ._models_py3 import TransferFilterDetails -from ._models_py3 import TransportAvailabilityDetails -from ._models_py3 import TransportAvailabilityRequest -from ._models_py3 import TransportAvailabilityResponse -from ._models_py3 import TransportPreferences -from ._models_py3 import UnencryptedCredentials -from ._models_py3 import UnencryptedCredentialsList -from ._models_py3 import UpdateJobDetails -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import UserAssignedProperties -from ._models_py3 import ValidateAddress -from ._models_py3 import ValidationInputRequest -from ._models_py3 import ValidationInputResponse -from ._models_py3 import ValidationRequest -from ._models_py3 import ValidationResponse - -from ._data_box_management_client_enums import AccessProtocol -from ._data_box_management_client_enums import AddressType -from ._data_box_management_client_enums import AddressValidationStatus -from ._data_box_management_client_enums import ClassDiscriminator -from ._data_box_management_client_enums import CopyStatus -from ._data_box_management_client_enums import CustomerResolutionCode -from ._data_box_management_client_enums import DataAccountType -from ._data_box_management_client_enums import DoubleEncryption -from ._data_box_management_client_enums import FilterFileType -from ._data_box_management_client_enums import JobDeliveryType -from ._data_box_management_client_enums import KekType -from ._data_box_management_client_enums import LogCollectionLevel -from ._data_box_management_client_enums import NotificationStageName -from ._data_box_management_client_enums import OverallValidationStatus -from ._data_box_management_client_enums import ShareDestinationFormatType -from ._data_box_management_client_enums import SkuDisabledReason -from ._data_box_management_client_enums import SkuName -from ._data_box_management_client_enums import StageName -from ._data_box_management_client_enums import StageStatus -from ._data_box_management_client_enums import TransferConfigurationType -from ._data_box_management_client_enums import TransferType -from ._data_box_management_client_enums import TransportShipmentTypes -from ._data_box_management_client_enums import ValidationInputDiscriminator -from ._data_box_management_client_enums import ValidationStatus -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccountCredentialDetails", - "AdditionalErrorInfo", - "AddressValidationOutput", - "AddressValidationProperties", - "ApiError", - "ApplianceNetworkConfiguration", - "ArmBaseObject", - "AvailableSkuRequest", - "AvailableSkusResult", - "AzureFileFilterDetails", - "BlobFilterDetails", - "CancellationReason", - "CloudError", - "ContactDetails", - "CopyLogDetails", - "CopyProgress", - "CreateJobValidations", - "CreateOrderLimitForSubscriptionValidationRequest", - "CreateOrderLimitForSubscriptionValidationResponseProperties", - "DataAccountDetails", - "DataBoxAccountCopyLogDetails", - "DataBoxDiskCopyLogDetails", - "DataBoxDiskCopyProgress", - "DataBoxDiskJobDetails", - "DataBoxDiskJobSecrets", - "DataBoxHeavyAccountCopyLogDetails", - "DataBoxHeavyJobDetails", - "DataBoxHeavyJobSecrets", - "DataBoxHeavySecret", - "DataBoxJobDetails", - "DataBoxScheduleAvailabilityRequest", - "DataBoxSecret", - "DataExportDetails", - "DataImportDetails", - "DataLocationToServiceLocationMap", - "DataTransferDetailsValidationRequest", - "DataTransferDetailsValidationResponseProperties", - "DataboxJobSecrets", - "DcAccessSecurityCode", - "Details", - "DiskScheduleAvailabilityRequest", - "DiskSecret", - "EncryptionPreferences", - "ErrorDetail", - "FilterFileDetails", - "HeavyScheduleAvailabilityRequest", - "IdentityProperties", - "JobDeliveryInfo", - "JobDetails", - "JobResource", - "JobResourceList", - "JobResourceUpdateParameter", - "JobSecrets", - "JobStages", - "KeyEncryptionKey", - "LastMitigationActionOnJob", - "ManagedDiskDetails", - "MitigateJobRequest", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationList", - "PackageShippingDetails", - "Preferences", - "PreferencesValidationRequest", - "PreferencesValidationResponseProperties", - "RegionConfigurationRequest", - "RegionConfigurationResponse", - "Resource", - "ResourceIdentity", - "ScheduleAvailabilityRequest", - "ScheduleAvailabilityResponse", - "ShareCredentialDetails", - "ShipmentPickUpRequest", - "ShipmentPickUpResponse", - "ShippingAddress", - "Sku", - "SkuAvailabilityValidationRequest", - "SkuAvailabilityValidationResponseProperties", - "SkuCapacity", - "SkuCost", - "SkuInformation", - "StorageAccountDetails", - "SubscriptionIsAllowedToCreateJobValidationRequest", - "SubscriptionIsAllowedToCreateJobValidationResponseProperties", - "SystemData", - "TransferAllDetails", - "TransferConfiguration", - "TransferConfigurationTransferAllDetails", - "TransferConfigurationTransferFilterDetails", - "TransferFilterDetails", - "TransportAvailabilityDetails", - "TransportAvailabilityRequest", - "TransportAvailabilityResponse", - "TransportPreferences", - "UnencryptedCredentials", - "UnencryptedCredentialsList", - "UpdateJobDetails", - "UserAssignedIdentity", - "UserAssignedProperties", - "ValidateAddress", - "ValidationInputRequest", - "ValidationInputResponse", - "ValidationRequest", - "ValidationResponse", - "AccessProtocol", - "AddressType", - "AddressValidationStatus", - "ClassDiscriminator", - "CopyStatus", - "CustomerResolutionCode", - "DataAccountType", - "DoubleEncryption", - "FilterFileType", - "JobDeliveryType", - "KekType", - "LogCollectionLevel", - "NotificationStageName", - "OverallValidationStatus", - "ShareDestinationFormatType", - "SkuDisabledReason", - "SkuName", - "StageName", - "StageStatus", - "TransferConfigurationType", - "TransferType", - "TransportShipmentTypes", - "ValidationInputDiscriminator", - "ValidationStatus", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_data_box_management_client_enums.py deleted file mode 100644 index ed1401b19daf..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_data_box_management_client_enums.py +++ /dev/null @@ -1,333 +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 enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" - - SMB = "SMB" - """Server Message Block protocol(SMB).""" - NFS = "NFS" - """Network File System protocol(NFS).""" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The address validation status.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the type of job details.""" - - DATA_BOX = "DataBox" - """Data Box orders.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk orders.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy orders.""" - - -class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Status of the copy.""" - - NOT_STARTED = "NotStarted" - """Data copy hasn't started yet.""" - IN_PROGRESS = "InProgress" - """Data copy is in progress.""" - COMPLETED = "Completed" - """Data copy completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Data copy completed with errors.""" - FAILED = "Failed" - """Data copy failed. No data was copied.""" - NOT_RETURNED = "NotReturned" - """No copy triggered as device was not returned.""" - HARDWARE_ERROR = "HardwareError" - """The Device has hit hardware issues.""" - DEVICE_FORMATTED = "DeviceFormatted" - """Data copy failed. The Device was formatted by user.""" - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" - """Data copy failed. Device metadata was modified by user.""" - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" - """Data copy failed. Storage Account was not accessible during copy.""" - UNSUPPORTED_DATA = "UnsupportedData" - """Data copy failed. The Device data content is not supported.""" - - -class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """CustomerResolutionCode.""" - - NONE = "None" - """No Resolution Yet""" - MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" - """Clean the device""" - RESUME = "Resume" - """Resume the job to same stage""" - - -class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the account.""" - - STORAGE_ACCOUNT = "StorageAccount" - """Storage Accounts .""" - MANAGED_DISK = "ManagedDisk" - """Azure Managed disk storage.""" - - -class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines secondary layer of software-based encryption enablement.""" - - ENABLED = "Enabled" - """Software-based encryption is enabled.""" - DISABLED = "Disabled" - """Software-based encryption is disabled.""" - - -class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the filter file.""" - - AZURE_BLOB = "AzureBlob" - """Filter file is of the type AzureBlob.""" - AZURE_FILE = "AzureFile" - """Filter file is of the type AzureFiles.""" - - -class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Delivery type of Job.""" - - NON_SCHEDULED = "NonScheduled" - """Non Scheduled job.""" - SCHEDULED = "Scheduled" - """Scheduled job.""" - - -class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of encryption key used for key encryption.""" - - MICROSOFT_MANAGED = "MicrosoftManaged" - """Key encryption key is managed by Microsoft.""" - CUSTOMER_MANAGED = "CustomerManaged" - """Key encryption key is managed by the Customer.""" - - -class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of the logs to be collected.""" - - ERROR = "Error" - """Only Errors will be collected in the logs.""" - VERBOSE = "Verbose" - """Verbose logging (includes Errors, CRC, size information and others).""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - DEVICE_PREPARED = "DevicePrepared" - """Notification at device prepared stage.""" - DISPATCHED = "Dispatched" - """Notification at device dispatched stage.""" - DELIVERED = "Delivered" - """Notification at device delivered stage.""" - PICKED_UP = "PickedUp" - """Notification at device picked up from user stage.""" - AT_AZURE_DC = "AtAzureDC" - """Notification at device received at Azure datacenter stage.""" - DATA_COPY = "DataCopy" - """Notification at data copy started stage.""" - - -class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall validation status.""" - - ALL_VALID_TO_PROCEED = "AllValidToProceed" - """Every input request is valid.""" - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" - """Some input requests are not valid.""" - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" - """Certain input validations skipped.""" - - -class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the share.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown format.""" - HCS = "HCS" - """Storsimple data format.""" - BLOCK_BLOB = "BlockBlob" - """Azure storage block blob format.""" - PAGE_BLOB = "PageBlob" - """Azure storage page blob format.""" - AZURE_FILE = "AzureFile" - """Azure storage file format.""" - MANAGED_DISK = "ManagedDisk" - """Azure Compute Disk.""" - - -class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the Sku is disabled.""" - - NONE = "None" - """SKU is not disabled.""" - COUNTRY = "Country" - """SKU is not available in the requested country.""" - REGION = "Region" - """SKU is not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled for the SKU.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types for the SKU.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" - - DATA_BOX = "DataBox" - """Data Box.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy.""" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage which is in progress.""" - - DEVICE_ORDERED = "DeviceOrdered" - """An order has been created.""" - DEVICE_PREPARED = "DevicePrepared" - """A device has been prepared for the order.""" - DISPATCHED = "Dispatched" - """Device has been dispatched to the user of the order.""" - DELIVERED = "Delivered" - """Device has been delivered to the user of the order.""" - PICKED_UP = "PickedUp" - """Device has been picked up from user and in transit to Azure datacenter.""" - AT_AZURE_DC = "AtAzureDC" - """Device has been received at Azure datacenter from the user.""" - DATA_COPY = "DataCopy" - """Data copy from the device at Azure datacenter.""" - COMPLETED = "Completed" - """Order has completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Order has completed with errors.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" - """Order has failed due to issue reported by user.""" - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" - """Order has failed due to issue detected at Azure datacenter.""" - ABORTED = "Aborted" - """Order has been aborted.""" - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - """Order has completed with warnings.""" - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" - """Device is ready to be handed to customer from Azure DC.""" - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" - """Device can be dropped off at Azure DC.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the job stage.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" - """Stage has succeeded with errors.""" - WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" - """Stage is stuck until customer takes some action.""" - SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" - """Stage has succeeded with warnings.""" - - -class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the configuration for transfer.""" - - TRANSFER_ALL = "TransferAll" - """Transfer all the data.""" - TRANSFER_USING_FILTER = "TransferUsingFilter" - """Transfer using filter.""" - - -class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the transfer.""" - - IMPORT_TO_AZURE = "ImportToAzure" - """Import data to azure.""" - EXPORT_FROM_AZURE = "ExportFromAzure" - """Export data from azure.""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Transport Shipment Type supported for given region.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Identifies the type of validation request.""" - - VALIDATE_ADDRESS = "ValidateAddress" - """Identify request and response of address validation.""" - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" - """Identify request and response for validation of subscription permission to create job.""" - VALIDATE_PREFERENCES = "ValidatePreferences" - """Identify request and response of preference validation.""" - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" - """Identify request and response of create order limit for subscription validation.""" - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" - """Identify request and response of active job limit for sku availability.""" - VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" - """Identify request and response of data transfer details validation.""" - - -class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Create order limit validation status.""" - - VALID = "Valid" - """Validation is successful""" - INVALID = "Invalid" - """Validation is not successful""" - SKIPPED = "Skipped" - """Validation is skipped""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_models_py3.py deleted file mode 100644 index a31e5e776271..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_models_py3.py +++ /dev/null @@ -1,4876 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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, 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 # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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.v2021_03_01.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.v2021_03_01.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): - """Additional error info. - - :ivar type: Additional error type. - :vartype type: str - :ivar info: Additional error info. - :vartype info: JSON - """ - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, *, type: Optional[str] = None, info: Optional[JSON] = None, **kwargs: Any) -> None: - """ - :keyword type: Additional error type. - :paramtype type: str - :keyword info: Additional error info. - :paramtype info: JSON - """ - super().__init__(**kwargs) - self.type = type - self.info = info - - -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.v2021_03_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2021_03_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2021_03_01.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 Azure. - - :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.v2021_03_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_03_01.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 Azure. - - :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.v2021_03_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2021_03_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2021_03_01.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 Azure. - - :ivar error: Required. - :vartype error: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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 Azure. - - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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 Azure. - - :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): - """Cloud error. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Cloud error code. - :vartype code: str - :ivar message: Cloud error message. - :vartype message: str - :ivar target: Cloud error target. - :vartype target: str - :ivar details: Cloud error details. - :vartype details: list[~azure.mgmt.databox.v2021_03_01.models.CloudError] - :ivar additional_info: Cloud error additional info. - :vartype additional_info: list[~azure.mgmt.databox.v2021_03_01.models.AdditionalErrorInfo] - """ - - _validation = { - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[CloudError]"}, - "additional_info": {"key": "additionalInfo", "type": "[AdditionalErrorInfo]"}, - } - - def __init__( - self, *, code: Optional[str] = None, message: Optional[str] = None, target: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword code: Cloud error code. - :paramtype code: str - :keyword message: Cloud error message. - :paramtype message: str - :keyword target: Cloud error target. - :paramtype target: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = None - self.additional_info = None - - -class ContactDetails(_serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_03_01.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.v2021_03_01.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 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, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails - - All required parameters must be populated in order to send to Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2021_03_01.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", - "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): # pylint: disable=too-many-instance-attributes - """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.v2021_03_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2021_03_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -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 Azure. - - :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.v2021_03_01.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.v2021_03_01.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 Azure. - - :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.v2021_03_01.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.v2021_03_01.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 Azure. - - :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.v2021_03_01.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): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_03_01.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - } - - def __init__(self, *, device_type: Union[str, "_models.SkuName"], **kwargs: Any) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.device_type = device_type - - -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_03_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError - :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_03_01.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 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 Azure. - - :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.v2021_03_01.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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2021_03_01.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 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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2021_03_01.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", and - "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.v2021_03_01.models.CopyStatus - """ - - _validation = { - "serial_number": {"readonly": True}, - "bytes_copied": {"readonly": True}, - "percent_complete": {"readonly": True}, - "status": {"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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Job details. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DataBoxJobDetails, 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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_03_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_03_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_03_01.models.LastMitigationActionOnJob - """ - - _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}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"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"}, - "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"}, - "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"}, - } - - _subtype_map = { - "job_details_type": { - "DataBox": "DataBoxJobDetails", - "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, - 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.v2021_03_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.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.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = 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 - - -class DataBoxDiskJobDetails(JobDetails): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_03_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_03_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_03_01.models.LastMitigationActionOnJob - :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.v2021_03_01.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :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}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"readonly": True}, - "copy_progress": {"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"}, - "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"}, - "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"}, - "preferred_disks": {"key": "preferredDisks", "type": "{int}"}, - "copy_progress": {"key": "copyProgress", "type": "[DataBoxDiskCopyProgress]"}, - "disks_and_size_details": {"key": "disksAndSizeDetails", "type": "{int}"}, - "passkey": {"key": "passkey", "type": "str"}, - } - - def __init__( - self, - *, - contact_details: "_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, - 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.v2021_03_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.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, - 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.disks_and_size_details = None - self.passkey = passkey - - -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, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_03_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_03_01.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", - "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 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_03_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2021_03_01.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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2021_03_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_03_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_03_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_03_01.models.LastMitigationActionOnJob - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.v2021_03_01.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}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"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"}, - "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"}, - "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"}, - "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, - 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.v2021_03_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.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, - 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_03_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_03_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_03_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_03_01.models.LastMitigationActionOnJob - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.v2021_03_01.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}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"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"}, - "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"}, - "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"}, - "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, - 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.v2021_03_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.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, - 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_03_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - _subtype_map = { - "sku_name": { - "DataBox": "DataBoxScheduleAvailabilityRequest", - "DataBoxDisk": "DiskScheduleAvailabilityRequest", - "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", - } - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name: Optional[str] = None - self.country = country - - -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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2021_03_01.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.v2021_03_01.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 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 Azure. - - :ivar transfer_configuration: Configuration for the data transfer. Required. - :vartype transfer_configuration: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.LogCollectionLevel - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2021_03_01.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: Union[str, "_models.LogCollectionLevel"] = "Error", - **kwargs: Any - ) -> None: - """ - :keyword transfer_configuration: Configuration for the data transfer. Required. - :paramtype transfer_configuration: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.LogCollectionLevel - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2021_03_01.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 Azure. - - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2021_03_01.models.DataAccountDetails - """ - - _validation = { - "account_details": {"required": True}, - } - - _attribute_map = { - "account_details": {"key": "accountDetails", "type": "DataAccountDetails"}, - } - - def __init__(self, *, account_details: "_models.DataAccountDetails", **kwargs: Any) -> None: - """ - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2021_03_01.models.DataAccountDetails - """ - super().__init__(**kwargs) - self.account_details = account_details - - -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 Azure. - - :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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.models.DataImportDetails] - :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransferType - """ - - _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"}, - } - - 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, - **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.v2021_03_01.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.v2021_03_01.models.DataImportDetails] - :keyword device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransferType - """ - 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 - - -class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): - """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 Azure. - - :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.v2021_03_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError - :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", - and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_03_01.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 Azure. - - :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 DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling disk orders. - - All required parameters must be populated in order to send to Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :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"}, - "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, - **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 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, **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.v2021_03_01.models.DoubleEncryption - """ - - _attribute_map = { - "double_encryption": {"key": "doubleEncryption", "type": "str"}, - } - - def __init__( - self, *, double_encryption: Union[str, "_models.DoubleEncryption"] = "Disabled", **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.v2021_03_01.models.DoubleEncryption - """ - super().__init__(**kwargs) - self.double_encryption = double_encryption - - -class ErrorDetail(_serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to Azure. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar details: - :vartype details: list[~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.Details] - :keyword target: - :paramtype target: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.details = details - self.target = target - - -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 Azure. - - :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.v2021_03_01.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.v2021_03_01.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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2021_03_01.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.v2021_03_01.models.UserAssignedProperties - """ - super().__init__(**kwargs) - self.type = type - self.user_assigned = user_assigned - - -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 Azure. - - :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.v2021_03_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2021_03_01.models.ResourceIdentity - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - self.identity = identity - - -class JobResource(Resource): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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.v2021_03_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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 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", and "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.CloudError - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.JobDeliveryType - :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.v2021_03_01.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: 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}, - "is_prepare_to_ship_enabled": {"readonly": True}, - "status": {"readonly": True}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "is_cancellable_without_fee": {"readonly": True}, - } - - _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"}, - "is_prepare_to_ship_enabled": {"key": "properties.isPrepareToShipEnabled", "type": "bool"}, - "status": {"key": "properties.status", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "error": {"key": "properties.error", "type": "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"}, - } - - def __init__( - 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.v2021_03_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.TransferType - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.v2021_03_01.models.JobDetails - :keyword delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :paramtype delivery_type: str or ~azure.mgmt.databox.v2021_03_01.models.JobDeliveryType - :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.v2021_03_01.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.is_prepare_to_ship_enabled = None - self.status = None - self.start_time = None - self.error = None - self.details = details - self.cancellation_reason = None - self.delivery_type = delivery_type - self.delivery_info = delivery_info - self.is_cancellable_without_fee = None - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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.v2021_03_01.models.ResourceIdentity - :ivar details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.ResourceIdentity - :keyword details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2021_03_01.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", and "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.v2021_03_01.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", and "SucceededWithWarnings". - :vartype stage_status: str or ~azure.mgmt.databox.v2021_03_01.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 - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"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"}, - } - - 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 - - -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 Azure. - - :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.v2021_03_01.models.KekType - :ivar identity_properties: Managed identity properties used for key encryption. - :vartype identity_properties: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.models.KekType - :keyword identity_properties: Managed identity properties used for key encryption. - :paramtype identity_properties: ~azure.mgmt.databox.v2021_03_01.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", and "Resume". - :vartype customer_resolution: str or - ~azure.mgmt.databox.v2021_03_01.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", and "Resume". - :paramtype customer_resolution: str or - ~azure.mgmt.databox.v2021_03_01.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 Azure. - - :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.v2021_03_01.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 MitigateJobRequest(_serialization.Model): - """The Mitigate Job captured from request body for Mitigate API. - - All required parameters must be populated in order to send to Azure. - - :ivar customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", and "Resume". - :vartype customer_resolution_code: str or - ~azure.mgmt.databox.v2021_03_01.models.CustomerResolutionCode - """ - - _validation = { - "customer_resolution_code": {"required": True}, - } - - _attribute_map = { - "customer_resolution_code": {"key": "customerResolutionCode", "type": "str"}, - } - - def __init__( - self, *, customer_resolution_code: Union[str, "_models.CustomerResolutionCode"], **kwargs: Any - ) -> None: - """ - :keyword customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", and "Resume". - :paramtype customer_resolution_code: str or - ~azure.mgmt.databox.v2021_03_01.models.CustomerResolutionCode - """ - super().__init__(**kwargs) - self.customer_resolution_code = customer_resolution_code - - -class NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :ivar stage_name: Name of the stage. Required. Known values are: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", and "DataCopy". - :vartype stage_name: str or ~azure.mgmt.databox.v2021_03_01.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", and "DataCopy". - :paramtype stage_name: str or ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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 PackageShippingDetails(_serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar tracking_id: Tracking Id of shipment. - :vartype tracking_id: str - :ivar tracking_url: Url where shipment can be tracked. - :vartype tracking_url: str - """ - - _validation = { - "carrier_name": {"readonly": True}, - "tracking_id": {"readonly": True}, - "tracking_url": {"readonly": True}, - } - - _attribute_map = { - "carrier_name": {"key": "carrierName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - "tracking_url": {"key": "trackingUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = 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.v2021_03_01.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: ~azure.mgmt.databox.v2021_03_01.models.EncryptionPreferences - """ - - _attribute_map = { - "preferred_data_center_region": {"key": "preferredDataCenterRegion", "type": "[str]"}, - "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, - "encryption_preferences": {"key": "encryptionPreferences", "type": "EncryptionPreferences"}, - } - - def __init__( - self, - *, - preferred_data_center_region: Optional[List[str]] = None, - transport_preferences: Optional["_models.TransportPreferences"] = None, - encryption_preferences: Optional["_models.EncryptionPreferences"] = 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.v2021_03_01.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: ~azure.mgmt.databox.v2021_03_01.models.EncryptionPreferences - """ - super().__init__(**kwargs) - self.preferred_data_center_region = preferred_data_center_region - self.transport_preferences = transport_preferences - self.encryption_preferences = encryption_preferences - - -class PreferencesValidationRequest(ValidationInputRequest): - """Request to validate preference of transport and data center. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_03_01.models.ValidationInputDiscriminator - :ivar preference: Preference of transport and data center. - :vartype preference: ~azure.mgmt.databox.v2021_03_01.models.Preferences - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - preference: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: Preference of transport and data center. - :paramtype preference: ~azure.mgmt.databox.v2021_03_01.models.Preferences - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.preference = preference - self.device_type = device_type - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_03_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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.v2021_03_01.models.ScheduleAvailabilityRequest - :ivar transport_availability_request: Request body to get the transport availability for given - sku. - :vartype transport_availability_request: - ~azure.mgmt.databox.v2021_03_01.models.TransportAvailabilityRequest - """ - - _attribute_map = { - "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, - "transport_availability_request": { - "key": "transportAvailabilityRequest", - "type": "TransportAvailabilityRequest", - }, - } - - def __init__( - self, - *, - schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_availability_request: Request body to get the availability for scheduling - orders. - :paramtype schedule_availability_request: - ~azure.mgmt.databox.v2021_03_01.models.ScheduleAvailabilityRequest - :keyword transport_availability_request: Request body to get the transport availability for - given sku. - :paramtype transport_availability_request: - ~azure.mgmt.databox.v2021_03_01.models.TransportAvailabilityRequest - """ - super().__init__(**kwargs) - self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_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.v2021_03_01.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.v2021_03_01.models.TransportAvailabilityResponse - """ - - _validation = { - "schedule_availability_response": {"readonly": True}, - "transport_availability_response": {"readonly": True}, - } - - _attribute_map = { - "schedule_availability_response": { - "key": "scheduleAvailabilityResponse", - "type": "ScheduleAvailabilityResponse", - }, - "transport_availability_response": { - "key": "transportAvailabilityResponse", - "type": "TransportAvailabilityResponse", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_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.v2021_03_01.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.v2021_03_01.models.UserAssignedIdentity] - """ - super().__init__(**kwargs) - self.type = type - self.principal_id = None - self.tenant_id = None - self.user_assigned_identities = user_assigned_identities - - -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.v2021_03_01.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.v2021_03_01.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 Azure. - - :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 Azure. - - :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.v2021_03_01.models.AddressType - """ - - _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"}, - } - - 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", - **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.v2021_03_01.models.AddressType - """ - 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 - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :vartype name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_03_01.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.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 - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - transfer_type: Union[str, "_models.TransferType"], - country: str, - location: str, - **kwargs: Any - ) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.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 - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.device_type = device_type - self.transfer_type = transfer_type - self.country = country - self.location = location - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_03_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError - :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_03_01.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 - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = 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.v2021_03_01.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.v2021_03_01.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2021_03_01.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -class StorageAccountDetails(DataAccountDetails): - """Details for the storage account. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_03_01.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): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_03_01.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): - """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 Azure. - - :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.v2021_03_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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 Azure. - - :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.v2021_03_01.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.v2021_03_01.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 Azure. - - :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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.models.TransferAllDetails - """ - super().__init__(**kwargs) - self.include = include - - -class TransferConfigurationTransferFilterDetails(_serialization.Model): - """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.v2021_03_01.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.v2021_03_01.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 Azure. - - :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.v2021_03_01.models.DataAccountType - :ivar blob_filter_details: Filter details to transfer blobs. - :vartype blob_filter_details: ~azure.mgmt.databox.v2021_03_01.models.BlobFilterDetails - :ivar azure_file_filter_details: Filter details to transfer Azure files. - :vartype azure_file_filter_details: - ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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.v2021_03_01.models.DataAccountType - :keyword blob_filter_details: Filter details to transfer blobs. - :paramtype blob_filter_details: ~azure.mgmt.databox.v2021_03_01.models.BlobFilterDetails - :keyword azure_file_filter_details: Filter details to transfer Azure files. - :paramtype azure_file_filter_details: - ~azure.mgmt.databox.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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", and - "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = None, **kwargs: Any) -> None: - """ - :keyword sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - - -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.v2021_03_01.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. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_03_01.models.TransportShipmentTypes - """ - - _validation = { - "preferred_shipment_type": {"required": True}, - } - - _attribute_map = { - "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, - } - - 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.v2021_03_01.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type - - -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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.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.v2021_03_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :ivar key_encryption_key: Key encryption key for the job. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey - """ - - _attribute_map = { - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - } - - def __init__( - self, - *, - contact_details: Optional["_models.ContactDetails"] = None, - shipping_address: Optional["_models.ShippingAddress"] = None, - key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. - :paramtype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :keyword key_encryption_key: Key encryption key for the job. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey - """ - super().__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address - self.key_encryption_key = key_encryption_key - - -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 Azure. - - :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.v2021_03_01.models.ValidationInputDiscriminator - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: ~azure.mgmt.databox.v2021_03_01.models.TransportPreferences - """ - - _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"}, - } - - def __init__( - self, - *, - shipping_address: "_models.ShippingAddress", - device_type: Union[str, "_models.SkuName"], - transport_preferences: Optional["_models.TransportPreferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: ~azure.mgmt.databox.v2021_03_01.models.TransportPreferences - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.shipping_address = shipping_address - self.device_type = device_type - self.transport_preferences = transport_preferences - - -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.v2021_03_01.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.v2021_03_01.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/v2021_03_01/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_data_box_management_client_operations.py deleted file mode 100644 index 64c601a9ad1f..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,210 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2021-03-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 = _format_url_section(_url, **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( # pylint: disable=inconsistent-return-statements - 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.v2021_03_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2021_03_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_jobs_operations.py deleted file mode 100644 index 009bbb92024c..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_jobs_operations.py +++ /dev/null @@ -1,1553 +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 typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, 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.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .._vendor import DataBoxManagementClientMixinABC, _convert_request, _format_url_section - -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", "2021-03-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 = _format_url_section(_url, **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_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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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.v2021_03_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_03_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_03_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_03_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2021_03_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2021-03-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_03_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_03_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_03_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2021_03_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_03_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2021_03_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - 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.v2021_03_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2021_03_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_operations.py deleted file mode 100644 index 58cacc55eec4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_operations.py +++ /dev/null @@ -1,155 +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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar -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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request - -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(**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", "2021-03-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2021_03_01.DataBoxManagementClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.models.Operation] - :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", "2021-03-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_service_operations.py deleted file mode 100644 index 1f746c6fc445..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_service_operations.py +++ /dev/null @@ -1,1083 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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", "2021-03-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 = _format_url_section(_url, **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.v2021_03_01.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.v2021_03_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2021_03_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.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", "2021-03-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2021_03_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2021_03_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2021_03_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_03_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_03_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_03_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_03_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2021_03_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-03-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_configuration.py deleted file mode 100644 index 4f41654b4f85..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-05-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2021-05-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_data_box_management_client.py deleted file mode 100644 index c2a21d5ea0e8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2021_05_01.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2021_05_01.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2021_05_01.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-05-01". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_metadata.json deleted file mode 100644 index a11ff6d73786..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "chosen_version": "2021-05-01", - "total_api_version_list": ["2021-05-01"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - }, - "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "sync_mixin_typing_definitions": "", - "async_mixin_typing_definitions": "", - "operations": { - "mitigate" : { - "sync": { - "signature": "def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_05_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_05_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - } - } - } - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_vendor.py deleted file mode 100644 index ec8d8f6dd7b4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_vendor.py +++ /dev/null @@ -1,48 +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 List, TYPE_CHECKING, cast - -from azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from .._serialization import Deserializer, Serializer - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - -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/v2021_05_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_configuration.py deleted file mode 100644 index 9d8a0c88b6e9..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-05-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2021-05-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_data_box_management_client.py deleted file mode 100644 index c0384889553e..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2021_05_01.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2021_05_01.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2021_05_01.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-05-01". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_vendor.py deleted file mode 100644 index 54f3d3ec6541..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_vendor.py +++ /dev/null @@ -1,28 +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 azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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/v2021_05_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_data_box_management_client_operations.py deleted file mode 100644 index d5702ee6beeb..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,176 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -from ...operations._data_box_management_client_operations import build_mitigate_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC): - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - 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.v2021_05_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2021_05_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_jobs_operations.py deleted file mode 100644 index 7f2a6d7885ad..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1279 +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 typing import Any, AsyncIterable, 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, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import 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 ..._vendor import _convert_request -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_update_request, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2021_05_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-05-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_05_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_05_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_05_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2021_05_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2021-05-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-05-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_05_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_05_01.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, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_05_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2021_05_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_05_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2021_05_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - 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.v2021_05_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2021_05_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_operations.py deleted file mode 100644 index 7cb78def255c..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_operations.py +++ /dev/null @@ -1,135 +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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -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 ..._vendor import _convert_request -from ...operations._operations import build_list_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2021_05_01.aio.DataBoxManagementClient`'s - :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") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.models.Operation] - :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", "2021-05-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_service_operations.py deleted file mode 100644 index 17cfa434d4a1..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_service_operations.py +++ /dev/null @@ -1,897 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2021_05_01.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.v2021_05_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2021_05_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2021_05_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2021_05_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2021_05_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_05_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_05_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_05_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_05_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2021_05_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/__init__.py deleted file mode 100644 index 52fb28c6d302..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/__init__.py +++ /dev/null @@ -1,275 +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 ._models_py3 import AccountCredentialDetails -from ._models_py3 import AdditionalErrorInfo -from ._models_py3 import AddressValidationOutput -from ._models_py3 import AddressValidationProperties -from ._models_py3 import ApiError -from ._models_py3 import ApplianceNetworkConfiguration -from ._models_py3 import ArmBaseObject -from ._models_py3 import AvailableSkuRequest -from ._models_py3 import AvailableSkusResult -from ._models_py3 import AzureFileFilterDetails -from ._models_py3 import BlobFilterDetails -from ._models_py3 import CancellationReason -from ._models_py3 import CloudError -from ._models_py3 import ContactDetails -from ._models_py3 import CopyLogDetails -from ._models_py3 import CopyProgress -from ._models_py3 import CreateJobValidations -from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest -from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties -from ._models_py3 import DataAccountDetails -from ._models_py3 import DataBoxAccountCopyLogDetails -from ._models_py3 import DataBoxDiskCopyLogDetails -from ._models_py3 import DataBoxDiskCopyProgress -from ._models_py3 import DataBoxDiskJobDetails -from ._models_py3 import DataBoxDiskJobSecrets -from ._models_py3 import DataBoxHeavyAccountCopyLogDetails -from ._models_py3 import DataBoxHeavyJobDetails -from ._models_py3 import DataBoxHeavyJobSecrets -from ._models_py3 import DataBoxHeavySecret -from ._models_py3 import DataBoxJobDetails -from ._models_py3 import DataBoxScheduleAvailabilityRequest -from ._models_py3 import DataBoxSecret -from ._models_py3 import DataExportDetails -from ._models_py3 import DataImportDetails -from ._models_py3 import DataLocationToServiceLocationMap -from ._models_py3 import DataTransferDetailsValidationRequest -from ._models_py3 import DataTransferDetailsValidationResponseProperties -from ._models_py3 import DataboxJobSecrets -from ._models_py3 import DcAccessSecurityCode -from ._models_py3 import Details -from ._models_py3 import DiskScheduleAvailabilityRequest -from ._models_py3 import DiskSecret -from ._models_py3 import EncryptionPreferences -from ._models_py3 import ErrorDetail -from ._models_py3 import FilterFileDetails -from ._models_py3 import HeavyScheduleAvailabilityRequest -from ._models_py3 import IdentityProperties -from ._models_py3 import JobDeliveryInfo -from ._models_py3 import JobDetails -from ._models_py3 import JobResource -from ._models_py3 import JobResourceList -from ._models_py3 import JobResourceUpdateParameter -from ._models_py3 import JobSecrets -from ._models_py3 import JobStages -from ._models_py3 import KeyEncryptionKey -from ._models_py3 import LastMitigationActionOnJob -from ._models_py3 import ManagedDiskDetails -from ._models_py3 import MitigateJobRequest -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import PackageShippingDetails -from ._models_py3 import Preferences -from ._models_py3 import PreferencesValidationRequest -from ._models_py3 import PreferencesValidationResponseProperties -from ._models_py3 import RegionConfigurationRequest -from ._models_py3 import RegionConfigurationResponse -from ._models_py3 import Resource -from ._models_py3 import ResourceIdentity -from ._models_py3 import ScheduleAvailabilityRequest -from ._models_py3 import ScheduleAvailabilityResponse -from ._models_py3 import ShareCredentialDetails -from ._models_py3 import ShipmentPickUpRequest -from ._models_py3 import ShipmentPickUpResponse -from ._models_py3 import ShippingAddress -from ._models_py3 import Sku -from ._models_py3 import SkuAvailabilityValidationRequest -from ._models_py3 import SkuAvailabilityValidationResponseProperties -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuInformation -from ._models_py3 import StorageAccountDetails -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties -from ._models_py3 import SystemData -from ._models_py3 import TransferAllDetails -from ._models_py3 import TransferConfiguration -from ._models_py3 import TransferConfigurationTransferAllDetails -from ._models_py3 import TransferConfigurationTransferFilterDetails -from ._models_py3 import TransferFilterDetails -from ._models_py3 import TransportAvailabilityDetails -from ._models_py3 import TransportAvailabilityRequest -from ._models_py3 import TransportAvailabilityResponse -from ._models_py3 import TransportPreferences -from ._models_py3 import UnencryptedCredentials -from ._models_py3 import UnencryptedCredentialsList -from ._models_py3 import UpdateJobDetails -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import UserAssignedProperties -from ._models_py3 import ValidateAddress -from ._models_py3 import ValidationInputRequest -from ._models_py3 import ValidationInputResponse -from ._models_py3 import ValidationRequest -from ._models_py3 import ValidationResponse - -from ._data_box_management_client_enums import AccessProtocol -from ._data_box_management_client_enums import AddressType -from ._data_box_management_client_enums import AddressValidationStatus -from ._data_box_management_client_enums import ClassDiscriminator -from ._data_box_management_client_enums import CopyStatus -from ._data_box_management_client_enums import CustomerResolutionCode -from ._data_box_management_client_enums import DataAccountType -from ._data_box_management_client_enums import DoubleEncryption -from ._data_box_management_client_enums import FilterFileType -from ._data_box_management_client_enums import JobDeliveryType -from ._data_box_management_client_enums import KekType -from ._data_box_management_client_enums import LogCollectionLevel -from ._data_box_management_client_enums import NotificationStageName -from ._data_box_management_client_enums import OverallValidationStatus -from ._data_box_management_client_enums import ShareDestinationFormatType -from ._data_box_management_client_enums import SkuDisabledReason -from ._data_box_management_client_enums import SkuName -from ._data_box_management_client_enums import StageName -from ._data_box_management_client_enums import StageStatus -from ._data_box_management_client_enums import TransferConfigurationType -from ._data_box_management_client_enums import TransferType -from ._data_box_management_client_enums import TransportShipmentTypes -from ._data_box_management_client_enums import ValidationInputDiscriminator -from ._data_box_management_client_enums import ValidationStatus -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccountCredentialDetails", - "AdditionalErrorInfo", - "AddressValidationOutput", - "AddressValidationProperties", - "ApiError", - "ApplianceNetworkConfiguration", - "ArmBaseObject", - "AvailableSkuRequest", - "AvailableSkusResult", - "AzureFileFilterDetails", - "BlobFilterDetails", - "CancellationReason", - "CloudError", - "ContactDetails", - "CopyLogDetails", - "CopyProgress", - "CreateJobValidations", - "CreateOrderLimitForSubscriptionValidationRequest", - "CreateOrderLimitForSubscriptionValidationResponseProperties", - "DataAccountDetails", - "DataBoxAccountCopyLogDetails", - "DataBoxDiskCopyLogDetails", - "DataBoxDiskCopyProgress", - "DataBoxDiskJobDetails", - "DataBoxDiskJobSecrets", - "DataBoxHeavyAccountCopyLogDetails", - "DataBoxHeavyJobDetails", - "DataBoxHeavyJobSecrets", - "DataBoxHeavySecret", - "DataBoxJobDetails", - "DataBoxScheduleAvailabilityRequest", - "DataBoxSecret", - "DataExportDetails", - "DataImportDetails", - "DataLocationToServiceLocationMap", - "DataTransferDetailsValidationRequest", - "DataTransferDetailsValidationResponseProperties", - "DataboxJobSecrets", - "DcAccessSecurityCode", - "Details", - "DiskScheduleAvailabilityRequest", - "DiskSecret", - "EncryptionPreferences", - "ErrorDetail", - "FilterFileDetails", - "HeavyScheduleAvailabilityRequest", - "IdentityProperties", - "JobDeliveryInfo", - "JobDetails", - "JobResource", - "JobResourceList", - "JobResourceUpdateParameter", - "JobSecrets", - "JobStages", - "KeyEncryptionKey", - "LastMitigationActionOnJob", - "ManagedDiskDetails", - "MitigateJobRequest", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationList", - "PackageShippingDetails", - "Preferences", - "PreferencesValidationRequest", - "PreferencesValidationResponseProperties", - "RegionConfigurationRequest", - "RegionConfigurationResponse", - "Resource", - "ResourceIdentity", - "ScheduleAvailabilityRequest", - "ScheduleAvailabilityResponse", - "ShareCredentialDetails", - "ShipmentPickUpRequest", - "ShipmentPickUpResponse", - "ShippingAddress", - "Sku", - "SkuAvailabilityValidationRequest", - "SkuAvailabilityValidationResponseProperties", - "SkuCapacity", - "SkuCost", - "SkuInformation", - "StorageAccountDetails", - "SubscriptionIsAllowedToCreateJobValidationRequest", - "SubscriptionIsAllowedToCreateJobValidationResponseProperties", - "SystemData", - "TransferAllDetails", - "TransferConfiguration", - "TransferConfigurationTransferAllDetails", - "TransferConfigurationTransferFilterDetails", - "TransferFilterDetails", - "TransportAvailabilityDetails", - "TransportAvailabilityRequest", - "TransportAvailabilityResponse", - "TransportPreferences", - "UnencryptedCredentials", - "UnencryptedCredentialsList", - "UpdateJobDetails", - "UserAssignedIdentity", - "UserAssignedProperties", - "ValidateAddress", - "ValidationInputRequest", - "ValidationInputResponse", - "ValidationRequest", - "ValidationResponse", - "AccessProtocol", - "AddressType", - "AddressValidationStatus", - "ClassDiscriminator", - "CopyStatus", - "CustomerResolutionCode", - "DataAccountType", - "DoubleEncryption", - "FilterFileType", - "JobDeliveryType", - "KekType", - "LogCollectionLevel", - "NotificationStageName", - "OverallValidationStatus", - "ShareDestinationFormatType", - "SkuDisabledReason", - "SkuName", - "StageName", - "StageStatus", - "TransferConfigurationType", - "TransferType", - "TransportShipmentTypes", - "ValidationInputDiscriminator", - "ValidationStatus", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_data_box_management_client_enums.py deleted file mode 100644 index 0db91ab675a5..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_data_box_management_client_enums.py +++ /dev/null @@ -1,339 +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 enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" - - SMB = "SMB" - """Server Message Block protocol(SMB).""" - NFS = "NFS" - """Network File System protocol(NFS).""" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The address validation status.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the type of job details.""" - - DATA_BOX = "DataBox" - """Data Box orders.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk orders.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy orders.""" - - -class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Status of the copy.""" - - NOT_STARTED = "NotStarted" - """Data copy hasn't started yet.""" - IN_PROGRESS = "InProgress" - """Data copy is in progress.""" - COMPLETED = "Completed" - """Data copy completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Data copy completed with errors.""" - FAILED = "Failed" - """Data copy failed. No data was copied.""" - NOT_RETURNED = "NotReturned" - """No copy triggered as device was not returned.""" - HARDWARE_ERROR = "HardwareError" - """The Device has hit hardware issues.""" - DEVICE_FORMATTED = "DeviceFormatted" - """Data copy failed. The Device was formatted by user.""" - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" - """Data copy failed. Device metadata was modified by user.""" - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" - """Data copy failed. Storage Account was not accessible during copy.""" - UNSUPPORTED_DATA = "UnsupportedData" - """Data copy failed. The Device data content is not supported.""" - - -class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """CustomerResolutionCode.""" - - NONE = "None" - """No Resolution Yet""" - MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" - """Clean the device""" - RESUME = "Resume" - """Resume the job to same stage""" - - -class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the account.""" - - STORAGE_ACCOUNT = "StorageAccount" - """Storage Accounts .""" - MANAGED_DISK = "ManagedDisk" - """Azure Managed disk storage.""" - - -class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines secondary layer of software-based encryption enablement.""" - - ENABLED = "Enabled" - """Software-based encryption is enabled.""" - DISABLED = "Disabled" - """Software-based encryption is disabled.""" - - -class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the filter file.""" - - AZURE_BLOB = "AzureBlob" - """Filter file is of the type AzureBlob.""" - AZURE_FILE = "AzureFile" - """Filter file is of the type AzureFiles.""" - - -class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Delivery type of Job.""" - - NON_SCHEDULED = "NonScheduled" - """Non Scheduled job.""" - SCHEDULED = "Scheduled" - """Scheduled job.""" - - -class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of encryption key used for key encryption.""" - - MICROSOFT_MANAGED = "MicrosoftManaged" - """Key encryption key is managed by Microsoft.""" - CUSTOMER_MANAGED = "CustomerManaged" - """Key encryption key is managed by the Customer.""" - - -class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of the logs to be collected.""" - - ERROR = "Error" - """Only Errors will be collected in the logs.""" - VERBOSE = "Verbose" - """Verbose logging (includes Errors, CRC, size information and others).""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - DEVICE_PREPARED = "DevicePrepared" - """Notification at device prepared stage.""" - DISPATCHED = "Dispatched" - """Notification at device dispatched stage.""" - DELIVERED = "Delivered" - """Notification at device delivered stage.""" - PICKED_UP = "PickedUp" - """Notification at device picked up from user stage.""" - AT_AZURE_DC = "AtAzureDC" - """Notification at device received at Azure datacenter stage.""" - DATA_COPY = "DataCopy" - """Notification at data copy started stage.""" - - -class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall validation status.""" - - ALL_VALID_TO_PROCEED = "AllValidToProceed" - """Every input request is valid.""" - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" - """Some input requests are not valid.""" - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" - """Certain input validations skipped.""" - - -class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the share.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown format.""" - HCS = "HCS" - """Storsimple data format.""" - BLOCK_BLOB = "BlockBlob" - """Azure storage block blob format.""" - PAGE_BLOB = "PageBlob" - """Azure storage page blob format.""" - AZURE_FILE = "AzureFile" - """Azure storage file format.""" - MANAGED_DISK = "ManagedDisk" - """Azure Compute Disk.""" - - -class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the Sku is disabled.""" - - NONE = "None" - """SKU is not disabled.""" - COUNTRY = "Country" - """SKU is not available in the requested country.""" - REGION = "Region" - """SKU is not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled for the SKU.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types for the SKU.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" - - DATA_BOX = "DataBox" - """Data Box.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy.""" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage which is in progress.""" - - DEVICE_ORDERED = "DeviceOrdered" - """An order has been created.""" - DEVICE_PREPARED = "DevicePrepared" - """A device has been prepared for the order.""" - DISPATCHED = "Dispatched" - """Device has been dispatched to the user of the order.""" - DELIVERED = "Delivered" - """Device has been delivered to the user of the order.""" - PICKED_UP = "PickedUp" - """Device has been picked up from user and in transit to Azure datacenter.""" - AT_AZURE_DC = "AtAzureDC" - """Device has been received at Azure datacenter from the user.""" - DATA_COPY = "DataCopy" - """Data copy from the device at Azure datacenter.""" - COMPLETED = "Completed" - """Order has completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Order has completed with errors.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" - """Order has failed due to issue reported by user.""" - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" - """Order has failed due to issue detected at Azure datacenter.""" - ABORTED = "Aborted" - """Order has been aborted.""" - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - """Order has completed with warnings.""" - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" - """Device is ready to be handed to customer from Azure DC.""" - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" - """Device can be dropped off at Azure DC.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the job stage.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" - """Stage has succeeded with errors.""" - WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" - """Stage is stuck until customer takes some action.""" - SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" - """Stage has succeeded with warnings.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" - """Stage is waiting for customer action for kek action items.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" - """Stage is waiting for customer action for clean up.""" - CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" - """Stage has performed customer action for clean up.""" - - -class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the configuration for transfer.""" - - TRANSFER_ALL = "TransferAll" - """Transfer all the data.""" - TRANSFER_USING_FILTER = "TransferUsingFilter" - """Transfer using filter.""" - - -class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the transfer.""" - - IMPORT_TO_AZURE = "ImportToAzure" - """Import data to azure.""" - EXPORT_FROM_AZURE = "ExportFromAzure" - """Export data from azure.""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Transport Shipment Type supported for given region.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Identifies the type of validation request.""" - - VALIDATE_ADDRESS = "ValidateAddress" - """Identify request and response of address validation.""" - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" - """Identify request and response for validation of subscription permission to create job.""" - VALIDATE_PREFERENCES = "ValidatePreferences" - """Identify request and response of preference validation.""" - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" - """Identify request and response of create order limit for subscription validation.""" - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" - """Identify request and response of active job limit for sku availability.""" - VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" - """Identify request and response of data transfer details validation.""" - - -class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Create order limit validation status.""" - - VALID = "Valid" - """Validation is successful""" - INVALID = "Invalid" - """Validation is not successful""" - SKIPPED = "Skipped" - """Validation is skipped""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_models_py3.py deleted file mode 100644 index f81036f4b8a0..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_models_py3.py +++ /dev/null @@ -1,4877 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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, 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 # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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.v2021_05_01.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.v2021_05_01.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): - """Additional error info. - - :ivar type: Additional error type. - :vartype type: str - :ivar info: Additional error info. - :vartype info: JSON - """ - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, *, type: Optional[str] = None, info: Optional[JSON] = None, **kwargs: Any) -> None: - """ - :keyword type: Additional error type. - :paramtype type: str - :keyword info: Additional error info. - :paramtype info: JSON - """ - super().__init__(**kwargs) - self.type = type - self.info = info - - -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.v2021_05_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2021_05_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2021_05_01.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 Azure. - - :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.v2021_05_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_05_01.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 Azure. - - :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.v2021_05_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2021_05_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2021_05_01.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 Azure. - - :ivar error: Required. - :vartype error: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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 Azure. - - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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 Azure. - - :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): - """Cloud error. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Cloud error code. - :vartype code: str - :ivar message: Cloud error message. - :vartype message: str - :ivar target: Cloud error target. - :vartype target: str - :ivar details: Cloud error details. - :vartype details: list[~azure.mgmt.databox.v2021_05_01.models.CloudError] - :ivar additional_info: Cloud error additional info. - :vartype additional_info: list[~azure.mgmt.databox.v2021_05_01.models.AdditionalErrorInfo] - """ - - _validation = { - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[CloudError]"}, - "additional_info": {"key": "additionalInfo", "type": "[AdditionalErrorInfo]"}, - } - - def __init__( - self, *, code: Optional[str] = None, message: Optional[str] = None, target: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword code: Cloud error code. - :paramtype code: str - :keyword message: Cloud error message. - :paramtype message: str - :keyword target: Cloud error target. - :paramtype target: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = None - self.additional_info = None - - -class ContactDetails(_serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_05_01.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.v2021_05_01.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 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, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails - - All required parameters must be populated in order to send to Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2021_05_01.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", - "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): # pylint: disable=too-many-instance-attributes - """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.v2021_05_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2021_05_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -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 Azure. - - :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.v2021_05_01.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.v2021_05_01.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 Azure. - - :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.v2021_05_01.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.v2021_05_01.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 Azure. - - :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.v2021_05_01.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): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_05_01.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - } - - def __init__(self, *, device_type: Union[str, "_models.SkuName"], **kwargs: Any) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.device_type = device_type - - -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_05_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError - :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_05_01.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 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 Azure. - - :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.v2021_05_01.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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2021_05_01.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 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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2021_05_01.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", and - "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.v2021_05_01.models.CopyStatus - """ - - _validation = { - "serial_number": {"readonly": True}, - "bytes_copied": {"readonly": True}, - "percent_complete": {"readonly": True}, - "status": {"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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Job details. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DataBoxJobDetails, 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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_05_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_05_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_05_01.models.LastMitigationActionOnJob - """ - - _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}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"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"}, - "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"}, - "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"}, - } - - _subtype_map = { - "job_details_type": { - "DataBox": "DataBoxJobDetails", - "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, - 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.v2021_05_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.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.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = 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 - - -class DataBoxDiskJobDetails(JobDetails): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_05_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_05_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_05_01.models.LastMitigationActionOnJob - :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.v2021_05_01.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :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}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"readonly": True}, - "copy_progress": {"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"}, - "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"}, - "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"}, - "preferred_disks": {"key": "preferredDisks", "type": "{int}"}, - "copy_progress": {"key": "copyProgress", "type": "[DataBoxDiskCopyProgress]"}, - "disks_and_size_details": {"key": "disksAndSizeDetails", "type": "{int}"}, - "passkey": {"key": "passkey", "type": "str"}, - } - - def __init__( - self, - *, - contact_details: "_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, - 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.v2021_05_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.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, - 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.disks_and_size_details = None - self.passkey = passkey - - -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, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_05_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_05_01.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", - "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 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_05_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2021_05_01.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 Azure. - - :ivar copy_log_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype copy_log_details_type: str or - ~azure.mgmt.databox.v2021_05_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_05_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_05_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_05_01.models.LastMitigationActionOnJob - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.v2021_05_01.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}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"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"}, - "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"}, - "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"}, - "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, - 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.v2021_05_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.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, - 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_05_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_05_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] - :ivar job_details_type: Indicates the type of job details. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_details_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_05_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_05_01.models.LastMitigationActionOnJob - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.v2021_05_01.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}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"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"}, - "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"}, - "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"}, - "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, - 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.v2021_05_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.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, - 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 Azure. - - :ivar job_secrets_type: Used to indicate what type of job secrets object. Required. Known - values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_05_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - _subtype_map = { - "sku_name": { - "DataBox": "DataBoxScheduleAvailabilityRequest", - "DataBoxDisk": "DiskScheduleAvailabilityRequest", - "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", - } - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name: Optional[str] = None - self.country = country - - -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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2021_05_01.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.v2021_05_01.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 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 Azure. - - :ivar transfer_configuration: Configuration for the data transfer. Required. - :vartype transfer_configuration: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.LogCollectionLevel - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2021_05_01.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: Union[str, "_models.LogCollectionLevel"] = "Error", - **kwargs: Any - ) -> None: - """ - :keyword transfer_configuration: Configuration for the data transfer. Required. - :paramtype transfer_configuration: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.LogCollectionLevel - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2021_05_01.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 Azure. - - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2021_05_01.models.DataAccountDetails - """ - - _validation = { - "account_details": {"required": True}, - } - - _attribute_map = { - "account_details": {"key": "accountDetails", "type": "DataAccountDetails"}, - } - - def __init__(self, *, account_details: "_models.DataAccountDetails", **kwargs: Any) -> None: - """ - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2021_05_01.models.DataAccountDetails - """ - super().__init__(**kwargs) - self.account_details = account_details - - -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 Azure. - - :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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.models.DataImportDetails] - :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransferType - """ - - _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"}, - } - - 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, - **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.v2021_05_01.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.v2021_05_01.models.DataImportDetails] - :keyword device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransferType - """ - 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 - - -class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): - """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 Azure. - - :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.v2021_05_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError - :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", - and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_05_01.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 Azure. - - :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 DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling disk orders. - - All required parameters must be populated in order to send to Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :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"}, - "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, - **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 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, **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.v2021_05_01.models.DoubleEncryption - """ - - _attribute_map = { - "double_encryption": {"key": "doubleEncryption", "type": "str"}, - } - - def __init__( - self, *, double_encryption: Union[str, "_models.DoubleEncryption"] = "Disabled", **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.v2021_05_01.models.DoubleEncryption - """ - super().__init__(**kwargs) - self.double_encryption = double_encryption - - -class ErrorDetail(_serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to Azure. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar details: - :vartype details: list[~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.Details] - :keyword target: - :paramtype target: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.details = details - self.target = target - - -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 Azure. - - :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.v2021_05_01.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.v2021_05_01.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 Azure. - - :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", and "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2021_05_01.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.v2021_05_01.models.UserAssignedProperties - """ - super().__init__(**kwargs) - self.type = type - self.user_assigned = user_assigned - - -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 Azure. - - :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.v2021_05_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2021_05_01.models.ResourceIdentity - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - self.identity = identity - - -class JobResource(Resource): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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.v2021_05_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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 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", and "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.CloudError - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.JobDeliveryType - :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.v2021_05_01.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: 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}, - "is_prepare_to_ship_enabled": {"readonly": True}, - "status": {"readonly": True}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "is_cancellable_without_fee": {"readonly": True}, - } - - _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"}, - "is_prepare_to_ship_enabled": {"key": "properties.isPrepareToShipEnabled", "type": "bool"}, - "status": {"key": "properties.status", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "error": {"key": "properties.error", "type": "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"}, - } - - def __init__( - 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.v2021_05_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.TransferType - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.v2021_05_01.models.JobDetails - :keyword delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :paramtype delivery_type: str or ~azure.mgmt.databox.v2021_05_01.models.JobDeliveryType - :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.v2021_05_01.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.is_prepare_to_ship_enabled = None - self.status = None - self.start_time = None - self.error = None - self.details = details - self.cancellation_reason = None - self.delivery_type = delivery_type - self.delivery_info = delivery_info - self.is_cancellable_without_fee = None - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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.v2021_05_01.models.ResourceIdentity - :ivar details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.ResourceIdentity - :keyword details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2021_05_01.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", and "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.v2021_05_01.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", and "CustomerActionPerformedForCleanUp". - :vartype stage_status: str or ~azure.mgmt.databox.v2021_05_01.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 - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"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"}, - } - - 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 - - -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 Azure. - - :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.v2021_05_01.models.KekType - :ivar identity_properties: Managed identity properties used for key encryption. - :vartype identity_properties: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.models.KekType - :keyword identity_properties: Managed identity properties used for key encryption. - :paramtype identity_properties: ~azure.mgmt.databox.v2021_05_01.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", and "Resume". - :vartype customer_resolution: str or - ~azure.mgmt.databox.v2021_05_01.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", and "Resume". - :paramtype customer_resolution: str or - ~azure.mgmt.databox.v2021_05_01.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 Azure. - - :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.v2021_05_01.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 MitigateJobRequest(_serialization.Model): - """The Mitigate Job captured from request body for Mitigate API. - - All required parameters must be populated in order to send to Azure. - - :ivar customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", and "Resume". - :vartype customer_resolution_code: str or - ~azure.mgmt.databox.v2021_05_01.models.CustomerResolutionCode - """ - - _validation = { - "customer_resolution_code": {"required": True}, - } - - _attribute_map = { - "customer_resolution_code": {"key": "customerResolutionCode", "type": "str"}, - } - - def __init__( - self, *, customer_resolution_code: Union[str, "_models.CustomerResolutionCode"], **kwargs: Any - ) -> None: - """ - :keyword customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", and "Resume". - :paramtype customer_resolution_code: str or - ~azure.mgmt.databox.v2021_05_01.models.CustomerResolutionCode - """ - super().__init__(**kwargs) - self.customer_resolution_code = customer_resolution_code - - -class NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :ivar stage_name: Name of the stage. Required. Known values are: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", and "DataCopy". - :vartype stage_name: str or ~azure.mgmt.databox.v2021_05_01.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", and "DataCopy". - :paramtype stage_name: str or ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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 PackageShippingDetails(_serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar tracking_id: Tracking Id of shipment. - :vartype tracking_id: str - :ivar tracking_url: Url where shipment can be tracked. - :vartype tracking_url: str - """ - - _validation = { - "carrier_name": {"readonly": True}, - "tracking_id": {"readonly": True}, - "tracking_url": {"readonly": True}, - } - - _attribute_map = { - "carrier_name": {"key": "carrierName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - "tracking_url": {"key": "trackingUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = 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.v2021_05_01.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: ~azure.mgmt.databox.v2021_05_01.models.EncryptionPreferences - """ - - _attribute_map = { - "preferred_data_center_region": {"key": "preferredDataCenterRegion", "type": "[str]"}, - "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, - "encryption_preferences": {"key": "encryptionPreferences", "type": "EncryptionPreferences"}, - } - - def __init__( - self, - *, - preferred_data_center_region: Optional[List[str]] = None, - transport_preferences: Optional["_models.TransportPreferences"] = None, - encryption_preferences: Optional["_models.EncryptionPreferences"] = 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.v2021_05_01.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: ~azure.mgmt.databox.v2021_05_01.models.EncryptionPreferences - """ - super().__init__(**kwargs) - self.preferred_data_center_region = preferred_data_center_region - self.transport_preferences = transport_preferences - self.encryption_preferences = encryption_preferences - - -class PreferencesValidationRequest(ValidationInputRequest): - """Request to validate preference of transport and data center. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_05_01.models.ValidationInputDiscriminator - :ivar preference: Preference of transport and data center. - :vartype preference: ~azure.mgmt.databox.v2021_05_01.models.Preferences - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - preference: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: Preference of transport and data center. - :paramtype preference: ~azure.mgmt.databox.v2021_05_01.models.Preferences - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.preference = preference - self.device_type = device_type - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_05_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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.v2021_05_01.models.ScheduleAvailabilityRequest - :ivar transport_availability_request: Request body to get the transport availability for given - sku. - :vartype transport_availability_request: - ~azure.mgmt.databox.v2021_05_01.models.TransportAvailabilityRequest - """ - - _attribute_map = { - "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, - "transport_availability_request": { - "key": "transportAvailabilityRequest", - "type": "TransportAvailabilityRequest", - }, - } - - def __init__( - self, - *, - schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_availability_request: Request body to get the availability for scheduling - orders. - :paramtype schedule_availability_request: - ~azure.mgmt.databox.v2021_05_01.models.ScheduleAvailabilityRequest - :keyword transport_availability_request: Request body to get the transport availability for - given sku. - :paramtype transport_availability_request: - ~azure.mgmt.databox.v2021_05_01.models.TransportAvailabilityRequest - """ - super().__init__(**kwargs) - self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_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.v2021_05_01.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.v2021_05_01.models.TransportAvailabilityResponse - """ - - _validation = { - "schedule_availability_response": {"readonly": True}, - "transport_availability_response": {"readonly": True}, - } - - _attribute_map = { - "schedule_availability_response": { - "key": "scheduleAvailabilityResponse", - "type": "ScheduleAvailabilityResponse", - }, - "transport_availability_response": { - "key": "transportAvailabilityResponse", - "type": "TransportAvailabilityResponse", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_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.v2021_05_01.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.v2021_05_01.models.UserAssignedIdentity] - """ - super().__init__(**kwargs) - self.type = type - self.principal_id = None - self.tenant_id = None - self.user_assigned_identities = user_assigned_identities - - -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.v2021_05_01.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.v2021_05_01.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 Azure. - - :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 Azure. - - :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.v2021_05_01.models.AddressType - """ - - _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"}, - } - - 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", - **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.v2021_05_01.models.AddressType - """ - 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 - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :vartype name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_05_01.models.ValidationInputDiscriminator - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.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 - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - transfer_type: Union[str, "_models.TransferType"], - country: str, - location: str, - **kwargs: Any - ) -> None: - """ - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.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 - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.device_type = device_type - self.transfer_type = transfer_type - self.country = country - self.location = location - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_05_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError - :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_05_01.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 - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = 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.v2021_05_01.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.v2021_05_01.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2021_05_01.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -class StorageAccountDetails(DataAccountDetails): - """Details for the storage account. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_05_01.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): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_05_01.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): - """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 Azure. - - :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.v2021_05_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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 Azure. - - :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.v2021_05_01.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.v2021_05_01.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 Azure. - - :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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.models.TransferAllDetails - """ - super().__init__(**kwargs) - self.include = include - - -class TransferConfigurationTransferFilterDetails(_serialization.Model): - """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.v2021_05_01.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.v2021_05_01.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 Azure. - - :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.v2021_05_01.models.DataAccountType - :ivar blob_filter_details: Filter details to transfer blobs. - :vartype blob_filter_details: ~azure.mgmt.databox.v2021_05_01.models.BlobFilterDetails - :ivar azure_file_filter_details: Filter details to transfer Azure files. - :vartype azure_file_filter_details: - ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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.v2021_05_01.models.DataAccountType - :keyword blob_filter_details: Filter details to transfer blobs. - :paramtype blob_filter_details: ~azure.mgmt.databox.v2021_05_01.models.BlobFilterDetails - :keyword azure_file_filter_details: Filter details to transfer Azure files. - :paramtype azure_file_filter_details: - ~azure.mgmt.databox.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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", and - "DataBoxHeavy". - :vartype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = None, **kwargs: Any) -> None: - """ - :keyword sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", and - "DataBoxHeavy". - :paramtype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - - -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.v2021_05_01.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. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_05_01.models.TransportShipmentTypes - """ - - _validation = { - "preferred_shipment_type": {"required": True}, - } - - _attribute_map = { - "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, - } - - 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.v2021_05_01.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type - - -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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.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.v2021_05_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :ivar key_encryption_key: Key encryption key for the job. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey - """ - - _attribute_map = { - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyEncryptionKey"}, - } - - def __init__( - self, - *, - contact_details: Optional["_models.ContactDetails"] = None, - shipping_address: Optional["_models.ShippingAddress"] = None, - key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_details: Contact details for notification and shipping. - :paramtype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :keyword key_encryption_key: Key encryption key for the job. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey - """ - super().__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address - self.key_encryption_key = key_encryption_key - - -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 Azure. - - :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.v2021_05_01.models.ValidationInputDiscriminator - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :ivar device_type: Device type to be used for the job. Required. Known values are: "DataBox", - "DataBoxDisk", and "DataBoxHeavy". - :vartype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: ~azure.mgmt.databox.v2021_05_01.models.TransportPreferences - """ - - _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"}, - } - - def __init__( - self, - *, - shipping_address: "_models.ShippingAddress", - device_type: Union[str, "_models.SkuName"], - transport_preferences: Optional["_models.TransportPreferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress - :keyword device_type: Device type to be used for the job. Required. Known values are: - "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: ~azure.mgmt.databox.v2021_05_01.models.TransportPreferences - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.shipping_address = shipping_address - self.device_type = device_type - self.transport_preferences = transport_preferences - - -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.v2021_05_01.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.v2021_05_01.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/v2021_05_01/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_data_box_management_client_operations.py deleted file mode 100644 index 57894b14f443..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,210 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2021-05-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 = _format_url_section(_url, **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( # pylint: disable=inconsistent-return-statements - 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.v2021_05_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2021_05_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_jobs_operations.py deleted file mode 100644 index 42661ab49d20..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_jobs_operations.py +++ /dev/null @@ -1,1553 +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 typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, 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.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .._vendor import DataBoxManagementClientMixinABC, _convert_request, _format_url_section - -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", "2021-05-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 = _format_url_section(_url, **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_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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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.v2021_05_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-05-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_05_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_05_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_05_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2021_05_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2021-05-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-05-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_05_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_05_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_05_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2021_05_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_05_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2021_05_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - 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.v2021_05_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2021_05_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_operations.py deleted file mode 100644 index 3fa30b00bee2..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_operations.py +++ /dev/null @@ -1,155 +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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar -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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request - -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(**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", "2021-05-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2021_05_01.DataBoxManagementClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.models.Operation] - :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", "2021-05-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_service_operations.py deleted file mode 100644 index 44b1fc10bee6..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_service_operations.py +++ /dev/null @@ -1,1083 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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", "2021-05-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 = _format_url_section(_url, **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.v2021_05_01.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.v2021_05_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2021_05_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.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", "2021-05-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2021_05_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2021_05_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2021_05_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_05_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_05_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_05_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_05_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2021_05_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-05-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_configuration.py deleted file mode 100644 index fc4781510922..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-08-01-preview". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2021-08-01-preview") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_data_box_management_client.py deleted file mode 100644 index 1780310bb86d..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2021_08_01_preview.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2021_08_01_preview.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2021_08_01_preview.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-08-01-preview". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_metadata.json deleted file mode 100644 index 723bb3551693..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "chosen_version": "2021-08-01-preview", - "total_api_version_list": ["2021-08-01-preview"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - }, - "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "sync_mixin_typing_definitions": "", - "async_mixin_typing_definitions": "", - "operations": { - "mitigate" : { - "sync": { - "signature": "def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_08_01_preview.models.MitigateJobRequest\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_08_01_preview.models.MitigateJobRequest\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - } - } - } - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_vendor.py deleted file mode 100644 index ec8d8f6dd7b4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_vendor.py +++ /dev/null @@ -1,48 +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 List, TYPE_CHECKING, cast - -from azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from .._serialization import Deserializer, Serializer - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - -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/v2021_08_01_preview/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_configuration.py deleted file mode 100644 index 9a72dd05cbe2..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-08-01-preview". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2021-08-01-preview") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_data_box_management_client.py deleted file mode 100644 index f9a3b3896ae9..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2021_08_01_preview.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2021_08_01_preview.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2021_08_01_preview.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-08-01-preview". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_data_box_management_client_operations.py deleted file mode 100644 index dd6395df7fcf..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,177 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -from ...operations._data_box_management_client_operations import build_mitigate_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC): - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - 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.v2021_08_01_preview.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2021_08_01_preview.models.MitigateJobRequest - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index be495fac17ef..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1432 +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 typing import Any, AsyncIterable, 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, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2021_08_01_preview.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @overload - async def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - 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.v2021_08_01_preview.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async 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], - **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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.mark_devices_shipped.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_08_01_preview.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_08_01_preview.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_08_01_preview.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2021_08_01_preview.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2021-08-01-preview")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_08_01_preview.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_08_01_preview.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, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_08_01_preview.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2021_08_01_preview.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_08_01_preview.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.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], - **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 type. Required. - :type shipment_pick_up_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.ShipmentPickUpRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - 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.v2021_08_01_preview.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2021_08_01_preview.models.CancellationReason or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_operations.py deleted file mode 100644 index 981c903171ac..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,135 +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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -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 ..._vendor import _convert_request -from ...operations._operations import build_list_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2021_08_01_preview.aio.DataBoxManagementClient`'s - :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") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.Operation] - :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", "2021-08-01-preview")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_service_operations.py deleted file mode 100644 index 65d2e11b60ac..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_service_operations.py +++ /dev/null @@ -1,900 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2021_08_01_preview.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.v2021_08_01_preview.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2021_08_01_preview.models.AvailableSkuRequest - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2021_08_01_preview.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2021_08_01_preview.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_08_01_preview.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_08_01_preview.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2021_08_01_preview.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/__init__.py deleted file mode 100644 index d6a073334264..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/__init__.py +++ /dev/null @@ -1,305 +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 ._models_py3 import AccountCredentialDetails -from ._models_py3 import AdditionalErrorInfo -from ._models_py3 import AddressValidationOutput -from ._models_py3 import AddressValidationProperties -from ._models_py3 import ApiError -from ._models_py3 import ApplianceNetworkConfiguration -from ._models_py3 import ArmBaseObject -from ._models_py3 import AvailableSkuRequest -from ._models_py3 import AvailableSkusResult -from ._models_py3 import AzureFileFilterDetails -from ._models_py3 import BlobFilterDetails -from ._models_py3 import CancellationReason -from ._models_py3 import CloudError -from ._models_py3 import ContactDetails -from ._models_py3 import CopyLogDetails -from ._models_py3 import CopyProgress -from ._models_py3 import CreateJobValidations -from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest -from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties -from ._models_py3 import CustomerDiskJobSecrets -from ._models_py3 import DataAccountDetails -from ._models_py3 import DataBoxAccountCopyLogDetails -from ._models_py3 import DataBoxCustomerDiskCopyLogDetails -from ._models_py3 import DataBoxCustomerDiskCopyProgress -from ._models_py3 import DataBoxCustomerDiskJobDetails -from ._models_py3 import DataBoxDiskCopyLogDetails -from ._models_py3 import DataBoxDiskCopyProgress -from ._models_py3 import DataBoxDiskJobDetails -from ._models_py3 import DataBoxDiskJobSecrets -from ._models_py3 import DataBoxHeavyAccountCopyLogDetails -from ._models_py3 import DataBoxHeavyJobDetails -from ._models_py3 import DataBoxHeavyJobSecrets -from ._models_py3 import DataBoxHeavySecret -from ._models_py3 import DataBoxJobDetails -from ._models_py3 import DataBoxScheduleAvailabilityRequest -from ._models_py3 import DataBoxSecret -from ._models_py3 import DataExportDetails -from ._models_py3 import DataImportDetails -from ._models_py3 import DataLocationToServiceLocationMap -from ._models_py3 import DataTransferDetailsValidationRequest -from ._models_py3 import DataTransferDetailsValidationResponseProperties -from ._models_py3 import DataboxJobSecrets -from ._models_py3 import DatacenterAddressInstructionResponse -from ._models_py3 import DatacenterAddressLocationResponse -from ._models_py3 import DatacenterAddressRequest -from ._models_py3 import DatacenterAddressResponse -from ._models_py3 import DcAccessSecurityCode -from ._models_py3 import Details -from ._models_py3 import DiskScheduleAvailabilityRequest -from ._models_py3 import DiskSecret -from ._models_py3 import EncryptionPreferences -from ._models_py3 import ErrorDetail -from ._models_py3 import ExportDiskDetails -from ._models_py3 import FilterFileDetails -from ._models_py3 import HeavyScheduleAvailabilityRequest -from ._models_py3 import IdentityProperties -from ._models_py3 import ImportDiskDetails -from ._models_py3 import JobDeliveryInfo -from ._models_py3 import JobDetails -from ._models_py3 import JobResource -from ._models_py3 import JobResourceList -from ._models_py3 import JobResourceUpdateParameter -from ._models_py3 import JobSecrets -from ._models_py3 import JobStages -from ._models_py3 import KeyEncryptionKey -from ._models_py3 import LastMitigationActionOnJob -from ._models_py3 import ManagedDiskDetails -from ._models_py3 import MarkDevicesShippedRequest -from ._models_py3 import MitigateJobRequest -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import PackageCarrierDetails -from ._models_py3 import PackageCarrierInfo -from ._models_py3 import PackageShippingDetails -from ._models_py3 import Preferences -from ._models_py3 import PreferencesValidationRequest -from ._models_py3 import PreferencesValidationResponseProperties -from ._models_py3 import RegionConfigurationRequest -from ._models_py3 import RegionConfigurationResponse -from ._models_py3 import Resource -from ._models_py3 import ResourceIdentity -from ._models_py3 import ScheduleAvailabilityRequest -from ._models_py3 import ScheduleAvailabilityResponse -from ._models_py3 import ShareCredentialDetails -from ._models_py3 import ShipmentPickUpRequest -from ._models_py3 import ShipmentPickUpResponse -from ._models_py3 import ShippingAddress -from ._models_py3 import Sku -from ._models_py3 import SkuAvailabilityValidationRequest -from ._models_py3 import SkuAvailabilityValidationResponseProperties -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuInformation -from ._models_py3 import StorageAccountDetails -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties -from ._models_py3 import SystemData -from ._models_py3 import TransferAllDetails -from ._models_py3 import TransferConfiguration -from ._models_py3 import TransferConfigurationTransferAllDetails -from ._models_py3 import TransferConfigurationTransferFilterDetails -from ._models_py3 import TransferFilterDetails -from ._models_py3 import TransportAvailabilityDetails -from ._models_py3 import TransportAvailabilityRequest -from ._models_py3 import TransportAvailabilityResponse -from ._models_py3 import TransportPreferences -from ._models_py3 import UnencryptedCredentials -from ._models_py3 import UnencryptedCredentialsList -from ._models_py3 import UpdateJobDetails -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import UserAssignedProperties -from ._models_py3 import ValidateAddress -from ._models_py3 import ValidationInputRequest -from ._models_py3 import ValidationInputResponse -from ._models_py3 import ValidationRequest -from ._models_py3 import ValidationResponse - -from ._data_box_management_client_enums import AccessProtocol -from ._data_box_management_client_enums import AddressType -from ._data_box_management_client_enums import AddressValidationStatus -from ._data_box_management_client_enums import ClassDiscriminator -from ._data_box_management_client_enums import CopyStatus -from ._data_box_management_client_enums import CustomerResolutionCode -from ._data_box_management_client_enums import DataAccountType -from ._data_box_management_client_enums import DataCenterCode -from ._data_box_management_client_enums import DatacenterAddressType -from ._data_box_management_client_enums import DoubleEncryption -from ._data_box_management_client_enums import FilterFileType -from ._data_box_management_client_enums import JobDeliveryType -from ._data_box_management_client_enums import KekType -from ._data_box_management_client_enums import LogCollectionLevel -from ._data_box_management_client_enums import NotificationStageName -from ._data_box_management_client_enums import OverallValidationStatus -from ._data_box_management_client_enums import ShareDestinationFormatType -from ._data_box_management_client_enums import SkuDisabledReason -from ._data_box_management_client_enums import SkuName -from ._data_box_management_client_enums import StageName -from ._data_box_management_client_enums import StageStatus -from ._data_box_management_client_enums import TransferConfigurationType -from ._data_box_management_client_enums import TransferType -from ._data_box_management_client_enums import TransportShipmentTypes -from ._data_box_management_client_enums import ValidationInputDiscriminator -from ._data_box_management_client_enums import ValidationStatus -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccountCredentialDetails", - "AdditionalErrorInfo", - "AddressValidationOutput", - "AddressValidationProperties", - "ApiError", - "ApplianceNetworkConfiguration", - "ArmBaseObject", - "AvailableSkuRequest", - "AvailableSkusResult", - "AzureFileFilterDetails", - "BlobFilterDetails", - "CancellationReason", - "CloudError", - "ContactDetails", - "CopyLogDetails", - "CopyProgress", - "CreateJobValidations", - "CreateOrderLimitForSubscriptionValidationRequest", - "CreateOrderLimitForSubscriptionValidationResponseProperties", - "CustomerDiskJobSecrets", - "DataAccountDetails", - "DataBoxAccountCopyLogDetails", - "DataBoxCustomerDiskCopyLogDetails", - "DataBoxCustomerDiskCopyProgress", - "DataBoxCustomerDiskJobDetails", - "DataBoxDiskCopyLogDetails", - "DataBoxDiskCopyProgress", - "DataBoxDiskJobDetails", - "DataBoxDiskJobSecrets", - "DataBoxHeavyAccountCopyLogDetails", - "DataBoxHeavyJobDetails", - "DataBoxHeavyJobSecrets", - "DataBoxHeavySecret", - "DataBoxJobDetails", - "DataBoxScheduleAvailabilityRequest", - "DataBoxSecret", - "DataExportDetails", - "DataImportDetails", - "DataLocationToServiceLocationMap", - "DataTransferDetailsValidationRequest", - "DataTransferDetailsValidationResponseProperties", - "DataboxJobSecrets", - "DatacenterAddressInstructionResponse", - "DatacenterAddressLocationResponse", - "DatacenterAddressRequest", - "DatacenterAddressResponse", - "DcAccessSecurityCode", - "Details", - "DiskScheduleAvailabilityRequest", - "DiskSecret", - "EncryptionPreferences", - "ErrorDetail", - "ExportDiskDetails", - "FilterFileDetails", - "HeavyScheduleAvailabilityRequest", - "IdentityProperties", - "ImportDiskDetails", - "JobDeliveryInfo", - "JobDetails", - "JobResource", - "JobResourceList", - "JobResourceUpdateParameter", - "JobSecrets", - "JobStages", - "KeyEncryptionKey", - "LastMitigationActionOnJob", - "ManagedDiskDetails", - "MarkDevicesShippedRequest", - "MitigateJobRequest", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationList", - "PackageCarrierDetails", - "PackageCarrierInfo", - "PackageShippingDetails", - "Preferences", - "PreferencesValidationRequest", - "PreferencesValidationResponseProperties", - "RegionConfigurationRequest", - "RegionConfigurationResponse", - "Resource", - "ResourceIdentity", - "ScheduleAvailabilityRequest", - "ScheduleAvailabilityResponse", - "ShareCredentialDetails", - "ShipmentPickUpRequest", - "ShipmentPickUpResponse", - "ShippingAddress", - "Sku", - "SkuAvailabilityValidationRequest", - "SkuAvailabilityValidationResponseProperties", - "SkuCapacity", - "SkuCost", - "SkuInformation", - "StorageAccountDetails", - "SubscriptionIsAllowedToCreateJobValidationRequest", - "SubscriptionIsAllowedToCreateJobValidationResponseProperties", - "SystemData", - "TransferAllDetails", - "TransferConfiguration", - "TransferConfigurationTransferAllDetails", - "TransferConfigurationTransferFilterDetails", - "TransferFilterDetails", - "TransportAvailabilityDetails", - "TransportAvailabilityRequest", - "TransportAvailabilityResponse", - "TransportPreferences", - "UnencryptedCredentials", - "UnencryptedCredentialsList", - "UpdateJobDetails", - "UserAssignedIdentity", - "UserAssignedProperties", - "ValidateAddress", - "ValidationInputRequest", - "ValidationInputResponse", - "ValidationRequest", - "ValidationResponse", - "AccessProtocol", - "AddressType", - "AddressValidationStatus", - "ClassDiscriminator", - "CopyStatus", - "CustomerResolutionCode", - "DataAccountType", - "DataCenterCode", - "DatacenterAddressType", - "DoubleEncryption", - "FilterFileType", - "JobDeliveryType", - "KekType", - "LogCollectionLevel", - "NotificationStageName", - "OverallValidationStatus", - "ShareDestinationFormatType", - "SkuDisabledReason", - "SkuName", - "StageName", - "StageStatus", - "TransferConfigurationType", - "TransferType", - "TransportShipmentTypes", - "ValidationInputDiscriminator", - "ValidationStatus", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_data_box_management_client_enums.py deleted file mode 100644 index fc1b2f163419..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_data_box_management_client_enums.py +++ /dev/null @@ -1,438 +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 enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" - - SMB = "SMB" - """Server Message Block protocol(SMB).""" - NFS = "NFS" - """Network File System protocol(NFS).""" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The address validation status.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the type of job details.""" - - DATA_BOX = "DataBox" - """Data Box orders.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk orders.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy orders.""" - DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk orders.""" - - -class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Status of the copy.""" - - NOT_STARTED = "NotStarted" - """Data copy hasn't started yet.""" - IN_PROGRESS = "InProgress" - """Data copy is in progress.""" - COMPLETED = "Completed" - """Data copy completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Data copy completed with errors.""" - FAILED = "Failed" - """Data copy failed. No data was copied.""" - NOT_RETURNED = "NotReturned" - """No copy triggered as device was not returned.""" - HARDWARE_ERROR = "HardwareError" - """The Device has hit hardware issues.""" - DEVICE_FORMATTED = "DeviceFormatted" - """Data copy failed. The Device was formatted by user.""" - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" - """Data copy failed. Device metadata was modified by user.""" - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" - """Data copy failed. Storage Account was not accessible during copy.""" - UNSUPPORTED_DATA = "UnsupportedData" - """Data copy failed. The Device data content is not supported.""" - DRIVE_NOT_RECEIVED = "DriveNotReceived" - """No copy triggered as device was not received.""" - UNSUPPORTED_DRIVE = "UnsupportedDrive" - """No copy triggered as device type is not supported.""" - OTHER_SERVICE_ERROR = "OtherServiceError" - """Copy failed due to service error.""" - OTHER_USER_ERROR = "OtherUserError" - """Copy failed due to user error.""" - DRIVE_NOT_DETECTED = "DriveNotDetected" - """Copy failed due to disk detection error.""" - DRIVE_CORRUPTED = "DriveCorrupted" - """Copy failed due to corrupted drive.""" - METADATA_FILES_MODIFIED_OR_REMOVED = "MetadataFilesModifiedOrRemoved" - """Copy failed due to modified or removed metadata files.""" - - -class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """CustomerResolutionCode.""" - - NONE = "None" - """No Resolution Yet""" - MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" - """Clean the device""" - RESUME = "Resume" - """Resume the job to same stage""" - - -class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the account.""" - - STORAGE_ACCOUNT = "StorageAccount" - """Storage Accounts .""" - MANAGED_DISK = "ManagedDisk" - """Azure Managed disk storage.""" - - -class DatacenterAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data center address type.""" - - DATACENTER_ADDRESS_LOCATION = "DatacenterAddressLocation" - """Data center address location.""" - DATACENTER_ADDRESS_INSTRUCTION = "DatacenterAddressInstruction" - """Data center address instruction.""" - - -class DataCenterCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DataCenter code.""" - - INVALID = "Invalid" - BY2 = "BY2" - BY1 = "BY1" - ORK70 = "ORK70" - AM2 = "AM2" - AMS20 = "AMS20" - BY21 = "BY21" - BY24 = "BY24" - MWH01 = "MWH01" - AMS06 = "AMS06" - SSE90 = "SSE90" - SYD03 = "SYD03" - SYD23 = "SYD23" - CBR20 = "CBR20" - YTO20 = "YTO20" - CWL20 = "CWL20" - LON24 = "LON24" - BOM01 = "BOM01" - BL20 = "BL20" - BL7 = "BL7" - SEL20 = "SEL20" - TYO01 = "TYO01" - BN1 = "BN1" - SN5 = "SN5" - CYS04 = "CYS04" - TYO22 = "TYO22" - YTO21 = "YTO21" - YQB20 = "YQB20" - FRA22 = "FRA22" - MAA01 = "MAA01" - CPQ02 = "CPQ02" - CPQ20 = "CPQ20" - SIN20 = "SIN20" - HKG20 = "HKG20" - SG2 = "SG2" - MEL23 = "MEL23" - SEL21 = "SEL21" - OSA20 = "OSA20" - SHA03 = "SHA03" - BJB = "BJB" - JNB22 = "JNB22" - JNB21 = "JNB21" - MNZ21 = "MNZ21" - SN8 = "SN8" - AUH20 = "AUH20" - ZRH20 = "ZRH20" - PUS20 = "PUS20" - AD_HOC = "AdHoc" - CH1 = "CH1" - DSM05 = "DSM05" - BN7 = "BN7" - SN6 = "SN6" - PAR22 = "PAR22" - - -class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines secondary layer of software-based encryption enablement.""" - - ENABLED = "Enabled" - """Software-based encryption is enabled.""" - DISABLED = "Disabled" - """Software-based encryption is disabled.""" - - -class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the filter file.""" - - AZURE_BLOB = "AzureBlob" - """Filter file is of the type AzureBlob.""" - AZURE_FILE = "AzureFile" - """Filter file is of the type AzureFiles.""" - - -class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Delivery type of Job.""" - - NON_SCHEDULED = "NonScheduled" - """Non Scheduled job.""" - SCHEDULED = "Scheduled" - """Scheduled job.""" - - -class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of encryption key used for key encryption.""" - - MICROSOFT_MANAGED = "MicrosoftManaged" - """Key encryption key is managed by Microsoft.""" - CUSTOMER_MANAGED = "CustomerManaged" - """Key encryption key is managed by the Customer.""" - - -class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of the logs to be collected.""" - - ERROR = "Error" - """Only Errors will be collected in the logs.""" - VERBOSE = "Verbose" - """Verbose logging (includes Errors, CRC, size information and others).""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - DEVICE_PREPARED = "DevicePrepared" - """Notification at device prepared stage.""" - DISPATCHED = "Dispatched" - """Notification at device dispatched stage.""" - DELIVERED = "Delivered" - """Notification at device delivered stage.""" - PICKED_UP = "PickedUp" - """Notification at device picked up from user stage.""" - AT_AZURE_DC = "AtAzureDC" - """Notification at device received at Azure datacenter stage.""" - DATA_COPY = "DataCopy" - """Notification at data copy started stage.""" - CREATED = "Created" - """Notification at job created stage.""" - SHIPPED_TO_CUSTOMER = "ShippedToCustomer" - """Notification at shipped devices to customer stage.""" - - -class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall validation status.""" - - ALL_VALID_TO_PROCEED = "AllValidToProceed" - """Every input request is valid.""" - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" - """Some input requests are not valid.""" - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" - """Certain input validations skipped.""" - - -class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the share.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown format.""" - HCS = "HCS" - """Storsimple data format.""" - BLOCK_BLOB = "BlockBlob" - """Azure storage block blob format.""" - PAGE_BLOB = "PageBlob" - """Azure storage page blob format.""" - AZURE_FILE = "AzureFile" - """Azure storage file format.""" - MANAGED_DISK = "ManagedDisk" - """Azure Compute Disk.""" - - -class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the Sku is disabled.""" - - NONE = "None" - """SKU is not disabled.""" - COUNTRY = "Country" - """SKU is not available in the requested country.""" - REGION = "Region" - """SKU is not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled for the SKU.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types for the SKU.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" - - DATA_BOX = "DataBox" - """Data Box.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy.""" - DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk""" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage which is in progress.""" - - DEVICE_ORDERED = "DeviceOrdered" - """An order has been created.""" - DEVICE_PREPARED = "DevicePrepared" - """A device has been prepared for the order.""" - DISPATCHED = "Dispatched" - """Device has been dispatched to the user of the order.""" - DELIVERED = "Delivered" - """Device has been delivered to the user of the order.""" - PICKED_UP = "PickedUp" - """Device has been picked up from user and in transit to Azure datacenter.""" - AT_AZURE_DC = "AtAzureDC" - """Device has been received at Azure datacenter from the user.""" - DATA_COPY = "DataCopy" - """Data copy from the device at Azure datacenter.""" - COMPLETED = "Completed" - """Order has completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Order has completed with errors.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" - """Order has failed due to issue reported by user.""" - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" - """Order has failed due to issue detected at Azure datacenter.""" - ABORTED = "Aborted" - """Order has been aborted.""" - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - """Order has completed with warnings.""" - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" - """Device is ready to be handed to customer from Azure DC.""" - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" - """Device can be dropped off at Azure DC.""" - CREATED = "Created" - """Job created by the customer.""" - SHIPPED_TO_AZURE_DC = "ShippedToAzureDC" - """User shipped the device to AzureDC.""" - AWAITING_SHIPMENT_DETAILS = "AwaitingShipmentDetails" - """Awaiting shipment details of device from customer.""" - PREPARING_TO_SHIP_FROM_AZURE_DC = "PreparingToShipFromAzureDC" - """Preparing the device to ship to customer.""" - SHIPPED_TO_CUSTOMER = "ShippedToCustomer" - """Shipped the device to customer.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the job stage.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" - """Stage has succeeded with errors.""" - WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" - """Stage is stuck until customer takes some action.""" - SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" - """Stage has succeeded with warnings.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" - """Stage is waiting for customer action for kek action items.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" - """Stage is waiting for customer action for clean up.""" - CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" - """Stage has performed customer action for clean up.""" - - -class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the configuration for transfer.""" - - TRANSFER_ALL = "TransferAll" - """Transfer all the data.""" - TRANSFER_USING_FILTER = "TransferUsingFilter" - """Transfer using filter.""" - - -class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the transfer.""" - - IMPORT_TO_AZURE = "ImportToAzure" - """Import data to azure.""" - EXPORT_FROM_AZURE = "ExportFromAzure" - """Export data from azure.""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Transport Shipment Type supported for given region.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Identifies the type of validation request.""" - - VALIDATE_ADDRESS = "ValidateAddress" - """Identify request and response of address validation.""" - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" - """Identify request and response for validation of subscription permission to create job.""" - VALIDATE_PREFERENCES = "ValidatePreferences" - """Identify request and response of preference validation.""" - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" - """Identify request and response of create order limit for subscription validation.""" - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" - """Identify request and response of active job limit for sku availability.""" - VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" - """Identify request and response of data transfer details validation.""" - - -class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Create order limit validation status.""" - - VALID = "Valid" - """Validation is successful""" - INVALID = "Invalid" - """Validation is not successful""" - SKIPPED = "Skipped" - """Validation is skipped""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_models_py3.py deleted file mode 100644 index c0f6a1db496c..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_models_py3.py +++ /dev/null @@ -1,5847 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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, 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 # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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.v2021_08_01_preview.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.v2021_08_01_preview.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): - """Additional error info. - - :ivar type: Additional error type. - :vartype type: str - :ivar info: Additional error info. - :vartype info: JSON - """ - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, *, type: Optional[str] = None, info: Optional[JSON] = None, **kwargs: Any) -> None: - """ - :keyword type: Additional error type. - :paramtype type: str - :keyword info: Additional error info. - :paramtype info: JSON - """ - super().__init__(**kwargs) - self.type = type - self.info = info - - -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.v2021_08_01_preview.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2021_08_01_preview.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: - list[~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2021_08_01_preview.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: - list[~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :ivar error: Required. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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): - """Cloud error. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Cloud error code. - :vartype code: str - :ivar message: Cloud error message. - :vartype message: str - :ivar target: Cloud error target. - :vartype target: str - :ivar details: Cloud error details. - :vartype details: list[~azure.mgmt.databox.v2021_08_01_preview.models.CloudError] - :ivar additional_info: Cloud error additional info. - :vartype additional_info: - list[~azure.mgmt.databox.v2021_08_01_preview.models.AdditionalErrorInfo] - """ - - _validation = { - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[CloudError]"}, - "additional_info": {"key": "additionalInfo", "type": "[AdditionalErrorInfo]"}, - } - - def __init__( - self, *, code: Optional[str] = None, message: Optional[str] = None, target: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword code: Cloud error code. - :paramtype code: str - :keyword message: Cloud error message. - :paramtype message: str - :keyword target: Cloud error target. - :paramtype target: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = None - self.additional_info = None - - -class ContactDetails(_serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.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.v2021_08_01_preview.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 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 Azure. - - :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.v2021_08_01_preview.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): # pylint: disable=too-many-instance-attributes - """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.v2021_08_01_preview.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or - ~azure.mgmt.databox.v2021_08_01_preview.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -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 Azure. - - :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.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.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): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.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.v2021_08_01_preview.models.SkuName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - } - - def __init__(self, *, device_type: Union[str, "_models.SkuName"], **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.v2021_08_01_preview.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.device_type = device_type - - -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError - :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: - ~azure.mgmt.databox.v2021_08_01_preview.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: - ~azure.mgmt.databox.v2021_08_01_preview.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.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): # pylint: disable=too-many-instance-attributes - """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.v2021_08_01_preview.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or - ~azure.mgmt.databox.v2021_08_01_preview.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 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.v2021_08_01_preview.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}, - "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"}, - "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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: - list[~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_08_01_preview.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_08_01_preview.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: - ~azure.mgmt.databox.v2021_08_01_preview.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", "BN7", "SN6", and "PAR22". - :vartype data_center_code: str or ~azure.mgmt.databox.v2021_08_01_preview.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}, - "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"}, - "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"}, - "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, - 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.v2021_08_01_preview.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.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.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = 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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: - list[~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_08_01_preview.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_08_01_preview.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: - ~azure.mgmt.databox.v2021_08_01_preview.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", "BN7", "SN6", and "PAR22". - :vartype data_center_code: str or ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.models.ExportDiskDetails] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataBoxCustomerDiskCopyProgress] - :ivar deliver_to_dc_package_details: Delivery package shipping details. - :vartype deliver_to_dc_package_details: - ~azure.mgmt.databox.v2021_08_01_preview.models.PackageCarrierInfo - :ivar return_to_customer_package_details: Return package shipping details. Required. - :vartype return_to_customer_package_details: - ~azure.mgmt.databox.v2021_08_01_preview.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}, - "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"}, - "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"}, - "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, - 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.v2021_08_01_preview.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.ImportDiskDetails] - :keyword return_to_customer_package_details: Return package shipping details. Required. - :paramtype return_to_customer_package_details: - ~azure.mgmt.databox.v2021_08_01_preview.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, - 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 Azure. - - :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.v2021_08_01_preview.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.v2021_08_01_preview.models.CopyStatus - """ - - _validation = { - "serial_number": {"readonly": True}, - "bytes_copied": {"readonly": True}, - "percent_complete": {"readonly": True}, - "status": {"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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class DataBoxDiskJobDetails(JobDetails): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: - list[~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_08_01_preview.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_08_01_preview.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: - ~azure.mgmt.databox.v2021_08_01_preview.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", "BN7", "SN6", and "PAR22". - :vartype data_center_code: str or ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :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}, - "actions": {"readonly": True}, - "last_mitigation_action_on_job": {"readonly": True}, - "datacenter_address": {"readonly": True}, - "data_center_code": {"readonly": True}, - "copy_progress": {"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"}, - "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"}, - "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]"}, - "disks_and_size_details": {"key": "disksAndSizeDetails", "type": "{int}"}, - "passkey": {"key": "passkey", "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, - 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.v2021_08_01_preview.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.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, - 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.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 Azure. - - :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.v2021_08_01_preview.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: - ~azure.mgmt.databox.v2021_08_01_preview.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: - list[~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_08_01_preview.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_08_01_preview.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: - ~azure.mgmt.databox.v2021_08_01_preview.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", "BN7", "SN6", and "PAR22". - :vartype data_center_code: str or ~azure.mgmt.databox.v2021_08_01_preview.models.DataCenterCode - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.v2021_08_01_preview.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}, - "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"}, - "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"}, - "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, - 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.v2021_08_01_preview.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.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, - 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 Azure. - - :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.v2021_08_01_preview.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: - ~azure.mgmt.databox.v2021_08_01_preview.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: - ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: - list[~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_08_01_preview.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_08_01_preview.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: - ~azure.mgmt.databox.v2021_08_01_preview.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", "BN7", "SN6", and "PAR22". - :vartype data_center_code: str or ~azure.mgmt.databox.v2021_08_01_preview.models.DataCenterCode - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.v2021_08_01_preview.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}, - "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"}, - "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"}, - "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, - 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.v2021_08_01_preview.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: - list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.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, - 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 Azure. - - :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.v2021_08_01_preview.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: - ~azure.mgmt.databox.v2021_08_01_preview.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - _subtype_map = { - "sku_name": { - "DataBox": "DataBoxScheduleAvailabilityRequest", - "DataBoxDisk": "DiskScheduleAvailabilityRequest", - "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", - } - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name: Optional[str] = None - self.country = country - - -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 Azure. - - :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.v2021_08_01_preview.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2021_08_01_preview.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.models.SkuName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, storage_location: str, sku_name: Union[str, "_models.SkuName"], **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.v2021_08_01_preview.models.SkuName - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name = sku_name - - -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 Azure. - - :ivar transfer_configuration: Configuration for the data transfer. Required. - :vartype transfer_configuration: - ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.LogCollectionLevel - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.models.LogCollectionLevel - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.models.DataImportDetails] - :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType - """ - - _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"}, - } - - 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, - **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.v2021_08_01_preview.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.v2021_08_01_preview.models.DataImportDetails] - :keyword device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType - """ - 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 - - -class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): - """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 Azure. - - :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.v2021_08_01_preview.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError - :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", - and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :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 DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling disk orders. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :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"}, - "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, - **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 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, **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.v2021_08_01_preview.models.DoubleEncryption - """ - - _attribute_map = { - "double_encryption": {"key": "doubleEncryption", "type": "str"}, - } - - def __init__( - self, *, double_encryption: Union[str, "_models.DoubleEncryption"] = "Disabled", **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.v2021_08_01_preview.models.DoubleEncryption - """ - super().__init__(**kwargs) - self.double_encryption = double_encryption - - -class ErrorDetail(_serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to Azure. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar details: - :vartype details: list[~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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 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 Azure. - - :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.v2021_08_01_preview.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2021_08_01_preview.models.ResourceIdentity - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - self.identity = identity - - -class JobResource(Resource): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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.v2021_08_01_preview.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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 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.v2021_08_01_preview.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.v2021_08_01_preview.models.CloudError - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.JobDeliveryType - :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.v2021_08_01_preview.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: 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}, - "is_prepare_to_ship_enabled": {"readonly": True}, - "status": {"readonly": True}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "is_cancellable_without_fee": {"readonly": True}, - } - - _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"}, - "is_prepare_to_ship_enabled": {"key": "properties.isPrepareToShipEnabled", "type": "bool"}, - "status": {"key": "properties.status", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "error": {"key": "properties.error", "type": "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"}, - } - - def __init__( - 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.v2021_08_01_preview.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.TransferType - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.v2021_08_01_preview.models.JobDetails - :keyword delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :paramtype delivery_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.JobDeliveryType - :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.v2021_08_01_preview.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.is_prepare_to_ship_enabled = None - self.status = None - self.start_time = None - self.error = None - self.details = details - self.cancellation_reason = None - self.delivery_type = delivery_type - self.delivery_info = delivery_info - self.is_cancellable_without_fee = None - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.models.ResourceIdentity - :ivar details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.ResourceIdentity - :keyword details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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", and "CustomerActionPerformedForCleanUp". - :vartype stage_status: str or ~azure.mgmt.databox.v2021_08_01_preview.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 - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"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"}, - } - - 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 - - -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 Azure. - - :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.v2021_08_01_preview.models.KekType - :ivar identity_properties: Managed identity properties used for key encryption. - :vartype identity_properties: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.KekType - :keyword identity_properties: Managed identity properties used for key encryption. - :paramtype identity_properties: - ~azure.mgmt.databox.v2021_08_01_preview.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", and "Resume". - :vartype customer_resolution: str or - ~azure.mgmt.databox.v2021_08_01_preview.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", and "Resume". - :paramtype customer_resolution: str or - ~azure.mgmt.databox.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.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 Azure. - - :ivar deliver_to_dc_package_details: Delivery package details. Required. - :vartype deliver_to_dc_package_details: - ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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. - - All required parameters must be populated in order to send to Azure. - - :ivar customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", and "Resume". - :vartype customer_resolution_code: str or - ~azure.mgmt.databox.v2021_08_01_preview.models.CustomerResolutionCode - """ - - _validation = { - "customer_resolution_code": {"required": True}, - } - - _attribute_map = { - "customer_resolution_code": {"key": "customerResolutionCode", "type": "str"}, - } - - def __init__( - self, *, customer_resolution_code: Union[str, "_models.CustomerResolutionCode"], **kwargs: Any - ) -> None: - """ - :keyword customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", and "Resume". - :paramtype customer_resolution_code: str or - ~azure.mgmt.databox.v2021_08_01_preview.models.CustomerResolutionCode - """ - super().__init__(**kwargs) - self.customer_resolution_code = customer_resolution_code - - -class NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: - ~azure.mgmt.databox.v2021_08_01_preview.models.EncryptionPreferences - """ - - _attribute_map = { - "preferred_data_center_region": {"key": "preferredDataCenterRegion", "type": "[str]"}, - "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, - "encryption_preferences": {"key": "encryptionPreferences", "type": "EncryptionPreferences"}, - } - - def __init__( - self, - *, - preferred_data_center_region: Optional[List[str]] = None, - transport_preferences: Optional["_models.TransportPreferences"] = None, - encryption_preferences: Optional["_models.EncryptionPreferences"] = 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.v2021_08_01_preview.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: - ~azure.mgmt.databox.v2021_08_01_preview.models.EncryptionPreferences - """ - super().__init__(**kwargs) - self.preferred_data_center_region = preferred_data_center_region - self.transport_preferences = transport_preferences - self.encryption_preferences = encryption_preferences - - -class PreferencesValidationRequest(ValidationInputRequest): - """Request to validate preference of transport and data center. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.models.ValidationInputDiscriminator - :ivar preference: Preference of transport and data center. - :vartype preference: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.SkuName - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - preference: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: Preference of transport and data center. - :paramtype preference: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.preference = preference - self.device_type = device_type - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.models.ScheduleAvailabilityRequest - :ivar transport_availability_request: Request body to get the transport availability for given - sku. - :vartype transport_availability_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.TransportAvailabilityRequest - :ivar datacenter_address_request: Request body to get the datacenter address for given sku. - :vartype datacenter_address_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressRequest - """ - - _attribute_map = { - "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, - "transport_availability_request": { - "key": "transportAvailabilityRequest", - "type": "TransportAvailabilityRequest", - }, - "datacenter_address_request": {"key": "datacenterAddressRequest", "type": "DatacenterAddressRequest"}, - } - - def __init__( - self, - *, - schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, - datacenter_address_request: Optional["_models.DatacenterAddressRequest"] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_availability_request: Request body to get the availability for scheduling - orders. - :paramtype schedule_availability_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.ScheduleAvailabilityRequest - :keyword transport_availability_request: Request body to get the transport availability for - given sku. - :paramtype transport_availability_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.TransportAvailabilityRequest - :keyword datacenter_address_request: Request body to get the datacenter address for given sku. - :paramtype datacenter_address_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressRequest - """ - super().__init__(**kwargs) - self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_request - self.datacenter_address_request = datacenter_address_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.v2021_08_01_preview.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.v2021_08_01_preview.models.TransportAvailabilityResponse - :ivar datacenter_address_response: Datacenter address for given sku in a region. - :vartype datacenter_address_response: - ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressResponse - """ - - _validation = { - "schedule_availability_response": {"readonly": True}, - "transport_availability_response": {"readonly": True}, - "datacenter_address_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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_response = None - self.datacenter_address_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.v2021_08_01_preview.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.v2021_08_01_preview.models.UserAssignedIdentity] - """ - super().__init__(**kwargs) - self.type = type - self.principal_id = None - self.tenant_id = None - self.user_assigned_identities = user_assigned_identities - - -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.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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 Azure. - - :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.v2021_08_01_preview.models.AddressType - """ - - _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"}, - } - - 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", - **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.v2021_08_01_preview.models.AddressType - """ - 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 - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", - and "DataBoxCustomerDisk". - :vartype name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = 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.v2021_08_01_preview.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.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.v2021_08_01_preview.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.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 - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - transfer_type: Union[str, "_models.TransferType"], - country: str, - location: str, - **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.v2021_08_01_preview.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.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 - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.device_type = device_type - self.transfer_type = transfer_type - self.country = country - self.location = location - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError - :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_08_01_preview.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 - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = 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.v2021_08_01_preview.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.v2021_08_01_preview.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2021_08_01_preview.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -class StorageAccountDetails(DataAccountDetails): - """Details for the storage account. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.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): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.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): - """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 Azure. - - :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.v2021_08_01_preview.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.models.TransferAllDetails - """ - super().__init__(**kwargs) - self.include = include - - -class TransferConfigurationTransferFilterDetails(_serialization.Model): - """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.v2021_08_01_preview.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.v2021_08_01_preview.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 Azure. - - :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.v2021_08_01_preview.models.DataAccountType - :ivar blob_filter_details: Filter details to transfer blobs. - :vartype blob_filter_details: ~azure.mgmt.databox.v2021_08_01_preview.models.BlobFilterDetails - :ivar azure_file_filter_details: Filter details to transfer Azure files. - :vartype azure_file_filter_details: - ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.models.DataAccountType - :keyword blob_filter_details: Filter details to transfer blobs. - :paramtype blob_filter_details: - ~azure.mgmt.databox.v2021_08_01_preview.models.BlobFilterDetails - :keyword azure_file_filter_details: Filter details to transfer Azure files. - :paramtype azure_file_filter_details: - ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.models.SkuName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = 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.v2021_08_01_preview.models.SkuName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - - -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.v2021_08_01_preview.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. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_08_01_preview.models.TransportShipmentTypes - """ - - _validation = { - "preferred_shipment_type": {"required": True}, - } - - _attribute_map = { - "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, - } - - 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.v2021_08_01_preview.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type - - -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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.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.v2021_08_01_preview.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :ivar key_encryption_key: Key encryption key for the job. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey - :ivar return_to_customer_package_details: Return package details of job. - :vartype return_to_customer_package_details: - ~azure.mgmt.databox.v2021_08_01_preview.models.PackageCarrierDetails - """ - - _attribute_map = { - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "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, - 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.v2021_08_01_preview.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress - :keyword key_encryption_key: Key encryption key for the job. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey - :keyword return_to_customer_package_details: Return package details of job. - :paramtype return_to_customer_package_details: - ~azure.mgmt.databox.v2021_08_01_preview.models.PackageCarrierDetails - """ - super().__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address - 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 Azure. - - :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.v2021_08_01_preview.models.ValidationInputDiscriminator - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.SkuName - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: - ~azure.mgmt.databox.v2021_08_01_preview.models.TransportPreferences - """ - - _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"}, - } - - def __init__( - self, - *, - shipping_address: "_models.ShippingAddress", - device_type: Union[str, "_models.SkuName"], - transport_preferences: Optional["_models.TransportPreferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.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.v2021_08_01_preview.models.SkuName - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: - ~azure.mgmt.databox.v2021_08_01_preview.models.TransportPreferences - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.shipping_address = shipping_address - self.device_type = device_type - self.transport_preferences = transport_preferences - - -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.v2021_08_01_preview.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.v2021_08_01_preview.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/v2021_08_01_preview/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_data_box_management_client_operations.py deleted file mode 100644 index 7d071802c658..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,211 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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( # pylint: disable=inconsistent-return-statements - 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.v2021_08_01_preview.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2021_08_01_preview.models.MitigateJobRequest - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_jobs_operations.py deleted file mode 100644 index c10c8d5b9a2f..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,1741 +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 typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, 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.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .._vendor import DataBoxManagementClientMixinABC, _convert_request, _format_url_section - -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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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.v2021_08_01_preview.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @overload - def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - 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.v2021_08_01_preview.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @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], - **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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.mark_devices_shipped.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_08_01_preview.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_08_01_preview.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_08_01_preview.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2021_08_01_preview.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2021-08-01-preview")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_08_01_preview.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_08_01_preview.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_08_01_preview.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2021_08_01_preview.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_08_01_preview.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.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], - **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 type. Required. - :type shipment_pick_up_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.ShipmentPickUpRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - 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.v2021_08_01_preview.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2021_08_01_preview.models.CancellationReason or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_operations.py deleted file mode 100644 index 698998454f77..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_operations.py +++ /dev/null @@ -1,155 +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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar -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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request - -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(**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", "2021-08-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2021_08_01_preview.DataBoxManagementClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.Operation] - :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", "2021-08-01-preview")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_service_operations.py deleted file mode 100644 index 5b42d1f7408f..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_service_operations.py +++ /dev/null @@ -1,1089 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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", "2021-08-01-preview")) - 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 = _format_url_section(_url, **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.v2021_08_01_preview.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.v2021_08_01_preview.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2021_08_01_preview.models.AvailableSkuRequest - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.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", "2021-08-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2021_08_01_preview.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2021_08_01_preview.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_08_01_preview.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_08_01_preview.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2021_08_01_preview.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-08-01-preview")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_configuration.py deleted file mode 100644 index 9cce461a3a33..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-12-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2021-12-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_data_box_management_client.py deleted file mode 100644 index 7fbf42ad5361..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2021_12_01.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2021_12_01.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2021_12_01.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-12-01". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_metadata.json deleted file mode 100644 index 9be4f502274b..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "chosen_version": "2021-12-01", - "total_api_version_list": ["2021-12-01"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - }, - "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "sync_mixin_typing_definitions": "", - "async_mixin_typing_definitions": "", - "operations": { - "mitigate" : { - "sync": { - "signature": "def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_12_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_12_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - } - } - } - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_vendor.py deleted file mode 100644 index ec8d8f6dd7b4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_vendor.py +++ /dev/null @@ -1,48 +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 List, TYPE_CHECKING, cast - -from azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from .._serialization import Deserializer, Serializer - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - -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/v2021_12_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_configuration.py deleted file mode 100644 index 771a4de4b788..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-12-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2021-12-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_data_box_management_client.py deleted file mode 100644 index a0e045602b21..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2021_12_01.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2021_12_01.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2021_12_01.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-12-01". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_vendor.py deleted file mode 100644 index 54f3d3ec6541..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_vendor.py +++ /dev/null @@ -1,28 +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 azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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/v2021_12_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_data_box_management_client_operations.py deleted file mode 100644 index 5576f92363e2..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,176 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -from ...operations._data_box_management_client_operations import build_mitigate_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC): - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - 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.v2021_12_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2021_12_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_jobs_operations.py deleted file mode 100644 index ca448438ed6c..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1424 +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 typing import Any, AsyncIterable, 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, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2021_12_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @overload - async def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - 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.v2021_12_01.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async 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], - **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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2021_12_01.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.mark_devices_shipped.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-12-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_12_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_12_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_12_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2021_12_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2021-12-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-12-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_12_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_12_01.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, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_12_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2021_12_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_12_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2021_12_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - 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.v2021_12_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2021_12_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_operations.py deleted file mode 100644 index 123f2db390eb..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_operations.py +++ /dev/null @@ -1,135 +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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -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 ..._vendor import _convert_request -from ...operations._operations import build_list_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2021_12_01.aio.DataBoxManagementClient`'s - :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") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_12_01.models.Operation] - :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", "2021-12-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_service_operations.py deleted file mode 100644 index d201b7bd09e4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_service_operations.py +++ /dev/null @@ -1,897 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2021_12_01.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.v2021_12_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_12_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_12_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2021_12_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2021_12_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2021_12_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2021_12_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_12_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_12_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_12_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_12_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2021_12_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/__init__.py deleted file mode 100644 index e1977c1e4b65..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/__init__.py +++ /dev/null @@ -1,313 +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 ._models_py3 import AccountCredentialDetails -from ._models_py3 import AdditionalErrorInfo -from ._models_py3 import AddressValidationOutput -from ._models_py3 import AddressValidationProperties -from ._models_py3 import ApiError -from ._models_py3 import ApplianceNetworkConfiguration -from ._models_py3 import ArmBaseObject -from ._models_py3 import AvailableSkuRequest -from ._models_py3 import AvailableSkusResult -from ._models_py3 import AzureFileFilterDetails -from ._models_py3 import BlobFilterDetails -from ._models_py3 import CancellationReason -from ._models_py3 import CloudError -from ._models_py3 import ContactDetails -from ._models_py3 import CopyLogDetails -from ._models_py3 import CopyProgress -from ._models_py3 import CreateJobValidations -from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest -from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties -from ._models_py3 import CustomerDiskJobSecrets -from ._models_py3 import DataAccountDetails -from ._models_py3 import DataBoxAccountCopyLogDetails -from ._models_py3 import DataBoxCustomerDiskCopyLogDetails -from ._models_py3 import DataBoxCustomerDiskCopyProgress -from ._models_py3 import DataBoxCustomerDiskJobDetails -from ._models_py3 import DataBoxDiskCopyLogDetails -from ._models_py3 import DataBoxDiskCopyProgress -from ._models_py3 import DataBoxDiskGranularCopyLogDetails -from ._models_py3 import DataBoxDiskGranularCopyProgress -from ._models_py3 import DataBoxDiskJobDetails -from ._models_py3 import DataBoxDiskJobSecrets -from ._models_py3 import DataBoxHeavyAccountCopyLogDetails -from ._models_py3 import DataBoxHeavyJobDetails -from ._models_py3 import DataBoxHeavyJobSecrets -from ._models_py3 import DataBoxHeavySecret -from ._models_py3 import DataBoxJobDetails -from ._models_py3 import DataBoxScheduleAvailabilityRequest -from ._models_py3 import DataBoxSecret -from ._models_py3 import DataExportDetails -from ._models_py3 import DataImportDetails -from ._models_py3 import DataLocationToServiceLocationMap -from ._models_py3 import DataTransferDetailsValidationRequest -from ._models_py3 import DataTransferDetailsValidationResponseProperties -from ._models_py3 import DataboxJobSecrets -from ._models_py3 import DatacenterAddressInstructionResponse -from ._models_py3 import DatacenterAddressLocationResponse -from ._models_py3 import DatacenterAddressRequest -from ._models_py3 import DatacenterAddressResponse -from ._models_py3 import DcAccessSecurityCode -from ._models_py3 import Details -from ._models_py3 import DiskScheduleAvailabilityRequest -from ._models_py3 import DiskSecret -from ._models_py3 import EncryptionPreferences -from ._models_py3 import ErrorDetail -from ._models_py3 import ExportDiskDetails -from ._models_py3 import FilterFileDetails -from ._models_py3 import GranularCopyLogDetails -from ._models_py3 import GranularCopyProgress -from ._models_py3 import HeavyScheduleAvailabilityRequest -from ._models_py3 import IdentityProperties -from ._models_py3 import ImportDiskDetails -from ._models_py3 import JobDeliveryInfo -from ._models_py3 import JobDetails -from ._models_py3 import JobResource -from ._models_py3 import JobResourceList -from ._models_py3 import JobResourceUpdateParameter -from ._models_py3 import JobSecrets -from ._models_py3 import JobStages -from ._models_py3 import KeyEncryptionKey -from ._models_py3 import LastMitigationActionOnJob -from ._models_py3 import ManagedDiskDetails -from ._models_py3 import MarkDevicesShippedRequest -from ._models_py3 import MitigateJobRequest -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import PackageCarrierDetails -from ._models_py3 import PackageCarrierInfo -from ._models_py3 import PackageShippingDetails -from ._models_py3 import Preferences -from ._models_py3 import PreferencesValidationRequest -from ._models_py3 import PreferencesValidationResponseProperties -from ._models_py3 import RegionConfigurationRequest -from ._models_py3 import RegionConfigurationResponse -from ._models_py3 import Resource -from ._models_py3 import ResourceIdentity -from ._models_py3 import ScheduleAvailabilityRequest -from ._models_py3 import ScheduleAvailabilityResponse -from ._models_py3 import ShareCredentialDetails -from ._models_py3 import ShipmentPickUpRequest -from ._models_py3 import ShipmentPickUpResponse -from ._models_py3 import ShippingAddress -from ._models_py3 import Sku -from ._models_py3 import SkuAvailabilityValidationRequest -from ._models_py3 import SkuAvailabilityValidationResponseProperties -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuInformation -from ._models_py3 import StorageAccountDetails -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties -from ._models_py3 import SystemData -from ._models_py3 import TransferAllDetails -from ._models_py3 import TransferConfiguration -from ._models_py3 import TransferConfigurationTransferAllDetails -from ._models_py3 import TransferConfigurationTransferFilterDetails -from ._models_py3 import TransferFilterDetails -from ._models_py3 import TransportAvailabilityDetails -from ._models_py3 import TransportAvailabilityRequest -from ._models_py3 import TransportAvailabilityResponse -from ._models_py3 import TransportPreferences -from ._models_py3 import UnencryptedCredentials -from ._models_py3 import UnencryptedCredentialsList -from ._models_py3 import UpdateJobDetails -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import UserAssignedProperties -from ._models_py3 import ValidateAddress -from ._models_py3 import ValidationInputRequest -from ._models_py3 import ValidationInputResponse -from ._models_py3 import ValidationRequest -from ._models_py3 import ValidationResponse - -from ._data_box_management_client_enums import AccessProtocol -from ._data_box_management_client_enums import AddressType -from ._data_box_management_client_enums import AddressValidationStatus -from ._data_box_management_client_enums import ClassDiscriminator -from ._data_box_management_client_enums import CopyStatus -from ._data_box_management_client_enums import CustomerResolutionCode -from ._data_box_management_client_enums import DataAccountType -from ._data_box_management_client_enums import DataCenterCode -from ._data_box_management_client_enums import DatacenterAddressType -from ._data_box_management_client_enums import DoubleEncryption -from ._data_box_management_client_enums import FilterFileType -from ._data_box_management_client_enums import JobDeliveryType -from ._data_box_management_client_enums import KekType -from ._data_box_management_client_enums import LogCollectionLevel -from ._data_box_management_client_enums import NotificationStageName -from ._data_box_management_client_enums import OverallValidationStatus -from ._data_box_management_client_enums import ShareDestinationFormatType -from ._data_box_management_client_enums import SkuDisabledReason -from ._data_box_management_client_enums import SkuName -from ._data_box_management_client_enums import StageName -from ._data_box_management_client_enums import StageStatus -from ._data_box_management_client_enums import TransferConfigurationType -from ._data_box_management_client_enums import TransferType -from ._data_box_management_client_enums import TransportShipmentTypes -from ._data_box_management_client_enums import ValidationInputDiscriminator -from ._data_box_management_client_enums import ValidationStatus -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccountCredentialDetails", - "AdditionalErrorInfo", - "AddressValidationOutput", - "AddressValidationProperties", - "ApiError", - "ApplianceNetworkConfiguration", - "ArmBaseObject", - "AvailableSkuRequest", - "AvailableSkusResult", - "AzureFileFilterDetails", - "BlobFilterDetails", - "CancellationReason", - "CloudError", - "ContactDetails", - "CopyLogDetails", - "CopyProgress", - "CreateJobValidations", - "CreateOrderLimitForSubscriptionValidationRequest", - "CreateOrderLimitForSubscriptionValidationResponseProperties", - "CustomerDiskJobSecrets", - "DataAccountDetails", - "DataBoxAccountCopyLogDetails", - "DataBoxCustomerDiskCopyLogDetails", - "DataBoxCustomerDiskCopyProgress", - "DataBoxCustomerDiskJobDetails", - "DataBoxDiskCopyLogDetails", - "DataBoxDiskCopyProgress", - "DataBoxDiskGranularCopyLogDetails", - "DataBoxDiskGranularCopyProgress", - "DataBoxDiskJobDetails", - "DataBoxDiskJobSecrets", - "DataBoxHeavyAccountCopyLogDetails", - "DataBoxHeavyJobDetails", - "DataBoxHeavyJobSecrets", - "DataBoxHeavySecret", - "DataBoxJobDetails", - "DataBoxScheduleAvailabilityRequest", - "DataBoxSecret", - "DataExportDetails", - "DataImportDetails", - "DataLocationToServiceLocationMap", - "DataTransferDetailsValidationRequest", - "DataTransferDetailsValidationResponseProperties", - "DataboxJobSecrets", - "DatacenterAddressInstructionResponse", - "DatacenterAddressLocationResponse", - "DatacenterAddressRequest", - "DatacenterAddressResponse", - "DcAccessSecurityCode", - "Details", - "DiskScheduleAvailabilityRequest", - "DiskSecret", - "EncryptionPreferences", - "ErrorDetail", - "ExportDiskDetails", - "FilterFileDetails", - "GranularCopyLogDetails", - "GranularCopyProgress", - "HeavyScheduleAvailabilityRequest", - "IdentityProperties", - "ImportDiskDetails", - "JobDeliveryInfo", - "JobDetails", - "JobResource", - "JobResourceList", - "JobResourceUpdateParameter", - "JobSecrets", - "JobStages", - "KeyEncryptionKey", - "LastMitigationActionOnJob", - "ManagedDiskDetails", - "MarkDevicesShippedRequest", - "MitigateJobRequest", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationList", - "PackageCarrierDetails", - "PackageCarrierInfo", - "PackageShippingDetails", - "Preferences", - "PreferencesValidationRequest", - "PreferencesValidationResponseProperties", - "RegionConfigurationRequest", - "RegionConfigurationResponse", - "Resource", - "ResourceIdentity", - "ScheduleAvailabilityRequest", - "ScheduleAvailabilityResponse", - "ShareCredentialDetails", - "ShipmentPickUpRequest", - "ShipmentPickUpResponse", - "ShippingAddress", - "Sku", - "SkuAvailabilityValidationRequest", - "SkuAvailabilityValidationResponseProperties", - "SkuCapacity", - "SkuCost", - "SkuInformation", - "StorageAccountDetails", - "SubscriptionIsAllowedToCreateJobValidationRequest", - "SubscriptionIsAllowedToCreateJobValidationResponseProperties", - "SystemData", - "TransferAllDetails", - "TransferConfiguration", - "TransferConfigurationTransferAllDetails", - "TransferConfigurationTransferFilterDetails", - "TransferFilterDetails", - "TransportAvailabilityDetails", - "TransportAvailabilityRequest", - "TransportAvailabilityResponse", - "TransportPreferences", - "UnencryptedCredentials", - "UnencryptedCredentialsList", - "UpdateJobDetails", - "UserAssignedIdentity", - "UserAssignedProperties", - "ValidateAddress", - "ValidationInputRequest", - "ValidationInputResponse", - "ValidationRequest", - "ValidationResponse", - "AccessProtocol", - "AddressType", - "AddressValidationStatus", - "ClassDiscriminator", - "CopyStatus", - "CustomerResolutionCode", - "DataAccountType", - "DataCenterCode", - "DatacenterAddressType", - "DoubleEncryption", - "FilterFileType", - "JobDeliveryType", - "KekType", - "LogCollectionLevel", - "NotificationStageName", - "OverallValidationStatus", - "ShareDestinationFormatType", - "SkuDisabledReason", - "SkuName", - "StageName", - "StageStatus", - "TransferConfigurationType", - "TransferType", - "TransportShipmentTypes", - "ValidationInputDiscriminator", - "ValidationStatus", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_data_box_management_client_enums.py deleted file mode 100644 index 3d7d80513a72..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_data_box_management_client_enums.py +++ /dev/null @@ -1,450 +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 enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" - - SMB = "SMB" - """Server Message Block protocol(SMB).""" - NFS = "NFS" - """Network File System protocol(NFS).""" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The address validation status.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the type of job details.""" - - DATA_BOX = "DataBox" - """Data Box orders.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk orders.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy orders.""" - DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk orders.""" - - -class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Status of the copy.""" - - NOT_STARTED = "NotStarted" - """Data copy hasn't started yet.""" - IN_PROGRESS = "InProgress" - """Data copy is in progress.""" - COMPLETED = "Completed" - """Data copy completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Data copy completed with errors.""" - FAILED = "Failed" - """Data copy failed. No data was copied.""" - NOT_RETURNED = "NotReturned" - """No copy triggered as device was not returned.""" - HARDWARE_ERROR = "HardwareError" - """The Device has hit hardware issues.""" - DEVICE_FORMATTED = "DeviceFormatted" - """Data copy failed. The Device was formatted by user.""" - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" - """Data copy failed. Device metadata was modified by user.""" - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" - """Data copy failed. Storage Account was not accessible during copy.""" - UNSUPPORTED_DATA = "UnsupportedData" - """Data copy failed. The Device data content is not supported.""" - DRIVE_NOT_RECEIVED = "DriveNotReceived" - """No copy triggered as device was not received.""" - UNSUPPORTED_DRIVE = "UnsupportedDrive" - """No copy triggered as device type is not supported.""" - OTHER_SERVICE_ERROR = "OtherServiceError" - """Copy failed due to service error.""" - OTHER_USER_ERROR = "OtherUserError" - """Copy failed due to user error.""" - DRIVE_NOT_DETECTED = "DriveNotDetected" - """Copy failed due to disk detection error.""" - DRIVE_CORRUPTED = "DriveCorrupted" - """Copy failed due to corrupted drive.""" - METADATA_FILES_MODIFIED_OR_REMOVED = "MetadataFilesModifiedOrRemoved" - """Copy failed due to modified or removed metadata files.""" - - -class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """CustomerResolutionCode.""" - - NONE = "None" - """No Resolution Yet""" - MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" - """Clean the device""" - RESUME = "Resume" - """Resume the job to same stage""" - RESTART = "Restart" - """Restart whole action.""" - REACH_OUT_TO_OPERATION = "ReachOutToOperation" - """Reach out to operation for further action.""" - - -class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the account.""" - - STORAGE_ACCOUNT = "StorageAccount" - """Storage Accounts .""" - MANAGED_DISK = "ManagedDisk" - """Azure Managed disk storage.""" - - -class DatacenterAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data center address type.""" - - DATACENTER_ADDRESS_LOCATION = "DatacenterAddressLocation" - """Data center address location.""" - DATACENTER_ADDRESS_INSTRUCTION = "DatacenterAddressInstruction" - """Data center address instruction.""" - - -class DataCenterCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DataCenter code.""" - - INVALID = "Invalid" - BY2 = "BY2" - BY1 = "BY1" - ORK70 = "ORK70" - AM2 = "AM2" - AMS20 = "AMS20" - BY21 = "BY21" - BY24 = "BY24" - MWH01 = "MWH01" - AMS06 = "AMS06" - SSE90 = "SSE90" - SYD03 = "SYD03" - SYD23 = "SYD23" - CBR20 = "CBR20" - YTO20 = "YTO20" - CWL20 = "CWL20" - LON24 = "LON24" - BOM01 = "BOM01" - BL20 = "BL20" - BL7 = "BL7" - SEL20 = "SEL20" - TYO01 = "TYO01" - BN1 = "BN1" - SN5 = "SN5" - CYS04 = "CYS04" - TYO22 = "TYO22" - YTO21 = "YTO21" - YQB20 = "YQB20" - FRA22 = "FRA22" - MAA01 = "MAA01" - CPQ02 = "CPQ02" - CPQ20 = "CPQ20" - SIN20 = "SIN20" - HKG20 = "HKG20" - SG2 = "SG2" - MEL23 = "MEL23" - SEL21 = "SEL21" - OSA20 = "OSA20" - SHA03 = "SHA03" - BJB = "BJB" - JNB22 = "JNB22" - JNB21 = "JNB21" - MNZ21 = "MNZ21" - SN8 = "SN8" - AUH20 = "AUH20" - ZRH20 = "ZRH20" - PUS20 = "PUS20" - AD_HOC = "AdHoc" - CH1 = "CH1" - DSM05 = "DSM05" - DUB07 = "DUB07" - PNQ01 = "PNQ01" - SVG20 = "SVG20" - OSA02 = "OSA02" - OSA22 = "OSA22" - PAR22 = "PAR22" - BN7 = "BN7" - SN6 = "SN6" - BJS20 = "BJS20" - - -class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines secondary layer of software-based encryption enablement.""" - - ENABLED = "Enabled" - """Software-based encryption is enabled.""" - DISABLED = "Disabled" - """Software-based encryption is disabled.""" - - -class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the filter file.""" - - AZURE_BLOB = "AzureBlob" - """Filter file is of the type AzureBlob.""" - AZURE_FILE = "AzureFile" - """Filter file is of the type AzureFiles.""" - - -class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Delivery type of Job.""" - - NON_SCHEDULED = "NonScheduled" - """Non Scheduled job.""" - SCHEDULED = "Scheduled" - """Scheduled job.""" - - -class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of encryption key used for key encryption.""" - - MICROSOFT_MANAGED = "MicrosoftManaged" - """Key encryption key is managed by Microsoft.""" - CUSTOMER_MANAGED = "CustomerManaged" - """Key encryption key is managed by the Customer.""" - - -class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of the logs to be collected.""" - - ERROR = "Error" - """Only Errors will be collected in the logs.""" - VERBOSE = "Verbose" - """Verbose logging (includes Errors, CRC, size information and others).""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - DEVICE_PREPARED = "DevicePrepared" - """Notification at device prepared stage.""" - DISPATCHED = "Dispatched" - """Notification at device dispatched stage.""" - DELIVERED = "Delivered" - """Notification at device delivered stage.""" - PICKED_UP = "PickedUp" - """Notification at device picked up from user stage.""" - AT_AZURE_DC = "AtAzureDC" - """Notification at device received at Azure datacenter stage.""" - DATA_COPY = "DataCopy" - """Notification at data copy started stage.""" - CREATED = "Created" - """Notification at job created stage.""" - SHIPPED_TO_CUSTOMER = "ShippedToCustomer" - """Notification at shipped devices to customer stage.""" - - -class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall validation status.""" - - ALL_VALID_TO_PROCEED = "AllValidToProceed" - """Every input request is valid.""" - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" - """Some input requests are not valid.""" - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" - """Certain input validations skipped.""" - - -class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the share.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown format.""" - HCS = "HCS" - """Storsimple data format.""" - BLOCK_BLOB = "BlockBlob" - """Azure storage block blob format.""" - PAGE_BLOB = "PageBlob" - """Azure storage page blob format.""" - AZURE_FILE = "AzureFile" - """Azure storage file format.""" - MANAGED_DISK = "ManagedDisk" - """Azure Compute Disk.""" - - -class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the Sku is disabled.""" - - NONE = "None" - """SKU is not disabled.""" - COUNTRY = "Country" - """SKU is not available in the requested country.""" - REGION = "Region" - """SKU is not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled for the SKU.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types for the SKU.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" - - DATA_BOX = "DataBox" - """Data Box.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy.""" - DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk""" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage which is in progress.""" - - DEVICE_ORDERED = "DeviceOrdered" - """An order has been created.""" - DEVICE_PREPARED = "DevicePrepared" - """A device has been prepared for the order.""" - DISPATCHED = "Dispatched" - """Device has been dispatched to the user of the order.""" - DELIVERED = "Delivered" - """Device has been delivered to the user of the order.""" - PICKED_UP = "PickedUp" - """Device has been picked up from user and in transit to Azure datacenter.""" - AT_AZURE_DC = "AtAzureDC" - """Device has been received at Azure datacenter from the user.""" - DATA_COPY = "DataCopy" - """Data copy from the device at Azure datacenter.""" - COMPLETED = "Completed" - """Order has completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Order has completed with errors.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" - """Order has failed due to issue reported by user.""" - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" - """Order has failed due to issue detected at Azure datacenter.""" - ABORTED = "Aborted" - """Order has been aborted.""" - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - """Order has completed with warnings.""" - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" - """Device is ready to be handed to customer from Azure DC.""" - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" - """Device can be dropped off at Azure DC.""" - CREATED = "Created" - """Job created by the customer.""" - SHIPPED_TO_AZURE_DC = "ShippedToAzureDC" - """User shipped the device to AzureDC.""" - AWAITING_SHIPMENT_DETAILS = "AwaitingShipmentDetails" - """Awaiting shipment details of device from customer.""" - PREPARING_TO_SHIP_FROM_AZURE_DC = "PreparingToShipFromAzureDC" - """Preparing the device to ship to customer.""" - SHIPPED_TO_CUSTOMER = "ShippedToCustomer" - """Shipped the device to customer.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the job stage.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" - """Stage has succeeded with errors.""" - WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" - """Stage is stuck until customer takes some action.""" - SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" - """Stage has succeeded with warnings.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" - """Stage is waiting for customer action for kek action items.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" - """Stage is waiting for customer action for clean up.""" - CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" - """Stage has performed customer action for clean up.""" - CUSTOMER_ACTION_PERFORMED = "CustomerActionPerformed" - """Stage has performed customer action.""" - - -class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the configuration for transfer.""" - - TRANSFER_ALL = "TransferAll" - """Transfer all the data.""" - TRANSFER_USING_FILTER = "TransferUsingFilter" - """Transfer using filter.""" - - -class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the transfer.""" - - IMPORT_TO_AZURE = "ImportToAzure" - """Import data to azure.""" - EXPORT_FROM_AZURE = "ExportFromAzure" - """Export data from azure.""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Transport Shipment Type supported for given region.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Identifies the type of validation request.""" - - VALIDATE_ADDRESS = "ValidateAddress" - """Identify request and response of address validation.""" - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" - """Identify request and response for validation of subscription permission to create job.""" - VALIDATE_PREFERENCES = "ValidatePreferences" - """Identify request and response of preference validation.""" - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" - """Identify request and response of create order limit for subscription validation.""" - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" - """Identify request and response of active job limit for sku availability.""" - VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" - """Identify request and response of data transfer details validation.""" - - -class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Create order limit validation status.""" - - VALID = "Valid" - """Validation is successful""" - INVALID = "Invalid" - """Validation is not successful""" - SKIPPED = "Skipped" - """Validation is skipped""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_models_py3.py deleted file mode 100644 index 0409f10f32d3..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_models_py3.py +++ /dev/null @@ -1,6057 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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, 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 # pylint: disable=ungrouped-imports -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_12_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2021_12_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2021_12_01.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 Azure. - - :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.v2021_12_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_12_01.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 Azure. - - :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.v2021_12_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_12_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2021_12_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2021_12_01.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 Azure. - - :ivar error: Required. - :vartype error: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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 Azure. - - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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 Azure. - - :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.v2021_12_01.models.AdditionalErrorInfo] - :ivar code: Error code. - :vartype code: str - :ivar details: Gets or sets details for the error. - :vartype details: list[~azure.mgmt.databox.v2021_12_01.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 Azure. - - :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.v2021_12_01.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.v2021_12_01.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 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 Azure. - - :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.v2021_12_01.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): # pylint: disable=too-many-instance-attributes - """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.v2021_12_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2021_12_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -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 Azure. - - :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.v2021_12_01.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.v2021_12_01.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 Azure. - - :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.v2021_12_01.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.v2021_12_01.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 Azure. - - :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.v2021_12_01.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): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_12_01.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.v2021_12_01.models.SkuName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - } - - def __init__(self, *, device_type: Union[str, "_models.SkuName"], **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.v2021_12_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.device_type = device_type - - -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_12_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_12_01.models.CloudError - :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_12_01.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 Azure. - - :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.v2021_12_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_12_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_12_01.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 Azure. - - :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.v2021_12_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_12_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_12_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2021_12_01.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 Azure. - - :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.v2021_12_01.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 Azure. - - :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.v2021_12_01.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 Azure. - - :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.v2021_12_01.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): # pylint: disable=too-many-instance-attributes - """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.v2021_12_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2021_12_01.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 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.v2021_12_01.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}, - "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"}, - "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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_12_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_12_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_12_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_12_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_12_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_12_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_12_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_12_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2021_12_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2021_12_01.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}, - "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"}, - "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"}, - "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, - 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.v2021_12_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_12_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_12_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_12_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.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.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = 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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_12_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_12_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_12_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_12_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_12_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_12_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_12_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_12_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2021_12_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.models.ExportDiskDetails] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: - list[~azure.mgmt.databox.v2021_12_01.models.DataBoxCustomerDiskCopyProgress] - :ivar deliver_to_dc_package_details: Delivery package shipping details. - :vartype deliver_to_dc_package_details: - ~azure.mgmt.databox.v2021_12_01.models.PackageCarrierInfo - :ivar return_to_customer_package_details: Return package shipping details. Required. - :vartype return_to_customer_package_details: - ~azure.mgmt.databox.v2021_12_01.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}, - "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"}, - "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"}, - "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, - 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.v2021_12_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_12_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_12_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_12_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.ImportDiskDetails] - :keyword return_to_customer_package_details: Return package shipping details. Required. - :paramtype return_to_customer_package_details: - ~azure.mgmt.databox.v2021_12_01.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, - 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 Azure. - - :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.v2021_12_01.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.v2021_12_01.models.CopyStatus - """ - - _validation = { - "serial_number": {"readonly": True}, - "bytes_copied": {"readonly": True}, - "percent_complete": {"readonly": True}, - "status": {"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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = 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 Azure. - - :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.v2021_12_01.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 Azure. - - :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.v2021_12_01.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): # pylint: disable=too-many-instance-attributes - """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.v2021_12_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2021_12_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -class DataBoxDiskGranularCopyProgress(GranularCopyProgress): # pylint: disable=too-many-instance-attributes - """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.v2021_12_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2021_12_01.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 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.v2021_12_01.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}, - "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"}, - "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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_12_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_12_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_12_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_12_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_12_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_12_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_12_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_12_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2021_12_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.DataBoxDiskCopyProgress] - :ivar granular_copy_progress: Copy progress per disk. - :vartype granular_copy_progress: - list[~azure.mgmt.databox.v2021_12_01.models.DataBoxDiskGranularCopyProgress] - :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}, - "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}, - "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"}, - "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"}, - "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]"}, - "disks_and_size_details": {"key": "disksAndSizeDetails", "type": "{int}"}, - "passkey": {"key": "passkey", "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, - 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.v2021_12_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_12_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_12_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_12_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.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, - 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.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 Azure. - - :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.v2021_12_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_12_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_12_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2021_12_01.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 Azure. - - :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.v2021_12_01.models.ClassDiscriminator - :ivar account_name: Account id. - :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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_12_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_12_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_12_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_12_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_12_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_12_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_12_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_12_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2021_12_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2021_12_01.models.DataCenterCode - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.v2021_12_01.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}, - "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"}, - "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"}, - "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, - 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.v2021_12_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_12_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_12_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_12_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.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, - 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 Azure. - - :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.v2021_12_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_12_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2021_12_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2021_12_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2021_12_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2021_12_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2021_12_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2021_12_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2021_12_01.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 key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2021_12_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2021_12_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2021_12_01.models.DataCenterCode - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.v2021_12_01.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}, - "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"}, - "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"}, - "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, - 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.v2021_12_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2021_12_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2021_12_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2021_12_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.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, - 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 Azure. - - :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.v2021_12_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_12_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2021_12_01.models.CloudError - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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 Azure. - - :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.v2021_12_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - _subtype_map = { - "sku_name": { - "DataBox": "DataBoxScheduleAvailabilityRequest", - "DataBoxDisk": "DiskScheduleAvailabilityRequest", - "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", - } - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name: Optional[str] = None - self.country = country - - -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 Azure. - - :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.v2021_12_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2021_12_01.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.v2021_12_01.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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2021_12_01.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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2021_12_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2021_12_01.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 Azure. - - :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.v2021_12_01.models.SkuName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, storage_location: str, sku_name: Union[str, "_models.SkuName"], **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.v2021_12_01.models.SkuName - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name = sku_name - - -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 Azure. - - :ivar transfer_configuration: Configuration for the data transfer. Required. - :vartype transfer_configuration: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.LogCollectionLevel - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.models.LogCollectionLevel - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2021_12_01.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 Azure. - - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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 Azure. - - :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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.models.DataImportDetails] - :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype device_type: str or ~azure.mgmt.databox.v2021_12_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_12_01.models.TransferType - """ - - _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"}, - } - - 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, - **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.v2021_12_01.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.v2021_12_01.models.DataImportDetails] - :keyword device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype device_type: str or ~azure.mgmt.databox.v2021_12_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_12_01.models.TransferType - """ - 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 - - -class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): - """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 Azure. - - :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.v2021_12_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_12_01.models.CloudError - :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", - and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_12_01.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 Azure. - - :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 DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling disk orders. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_12_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :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"}, - "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, - **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 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, **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.v2021_12_01.models.DoubleEncryption - """ - - _attribute_map = { - "double_encryption": {"key": "doubleEncryption", "type": "str"}, - } - - def __init__( - self, *, double_encryption: Union[str, "_models.DoubleEncryption"] = "Disabled", **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.v2021_12_01.models.DoubleEncryption - """ - super().__init__(**kwargs) - self.double_encryption = double_encryption - - -class ErrorDetail(_serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to Azure. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar details: - :vartype details: list[~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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 Azure. - - :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.v2021_12_01.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.v2021_12_01.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 Azure. - - :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.v2021_12_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2021_12_01.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.v2021_12_01.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 Azure. - - :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 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 Azure. - - :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.v2021_12_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2021_12_01.models.ResourceIdentity - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - self.identity = identity - - -class JobResource(Resource): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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.v2021_12_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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 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.v2021_12_01.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.v2021_12_01.models.CloudError - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.JobDeliveryType - :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.v2021_12_01.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: 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}, - "is_prepare_to_ship_enabled": {"readonly": True}, - "status": {"readonly": True}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "is_cancellable_without_fee": {"readonly": True}, - } - - _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"}, - "is_prepare_to_ship_enabled": {"key": "properties.isPrepareToShipEnabled", "type": "bool"}, - "status": {"key": "properties.status", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "error": {"key": "properties.error", "type": "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"}, - } - - def __init__( - 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.v2021_12_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.TransferType - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.v2021_12_01.models.JobDetails - :keyword delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :paramtype delivery_type: str or ~azure.mgmt.databox.v2021_12_01.models.JobDeliveryType - :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.v2021_12_01.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.is_prepare_to_ship_enabled = None - self.status = None - self.start_time = None - self.error = None - self.details = details - self.cancellation_reason = None - self.delivery_type = delivery_type - self.delivery_info = delivery_info - self.is_cancellable_without_fee = None - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.models.ResourceIdentity - :ivar details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.ResourceIdentity - :keyword details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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 - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"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"}, - } - - 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 - - -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 Azure. - - :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.v2021_12_01.models.KekType - :ivar identity_properties: Managed identity properties used for key encryption. - :vartype identity_properties: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.KekType - :keyword identity_properties: Managed identity properties used for key encryption. - :paramtype identity_properties: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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 Azure. - - :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.v2021_12_01.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 Azure. - - :ivar deliver_to_dc_package_details: Delivery package details. Required. - :vartype deliver_to_dc_package_details: - ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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. - - All required parameters must be populated in order to send to Azure. - - :ivar customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". - :vartype customer_resolution_code: str or - ~azure.mgmt.databox.v2021_12_01.models.CustomerResolutionCode - """ - - _validation = { - "customer_resolution_code": {"required": True}, - } - - _attribute_map = { - "customer_resolution_code": {"key": "customerResolutionCode", "type": "str"}, - } - - def __init__( - self, *, customer_resolution_code: Union[str, "_models.CustomerResolutionCode"], **kwargs: Any - ) -> None: - """ - :keyword customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". - :paramtype customer_resolution_code: str or - ~azure.mgmt.databox.v2021_12_01.models.CustomerResolutionCode - """ - super().__init__(**kwargs) - self.customer_resolution_code = customer_resolution_code - - -class NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: ~azure.mgmt.databox.v2021_12_01.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"}, - "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, - 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.v2021_12_01.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: ~azure.mgmt.databox.v2021_12_01.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.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 Azure. - - :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.v2021_12_01.models.ValidationInputDiscriminator - :ivar preference: Preference of transport and data center. - :vartype preference: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.SkuName - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - preference: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: Preference of transport and data center. - :paramtype preference: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.preference = preference - self.device_type = device_type - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_12_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.models.ScheduleAvailabilityRequest - :ivar transport_availability_request: Request body to get the transport availability for given - sku. - :vartype transport_availability_request: - ~azure.mgmt.databox.v2021_12_01.models.TransportAvailabilityRequest - :ivar datacenter_address_request: Request body to get the datacenter address for given sku. - :vartype datacenter_address_request: - ~azure.mgmt.databox.v2021_12_01.models.DatacenterAddressRequest - """ - - _attribute_map = { - "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, - "transport_availability_request": { - "key": "transportAvailabilityRequest", - "type": "TransportAvailabilityRequest", - }, - "datacenter_address_request": {"key": "datacenterAddressRequest", "type": "DatacenterAddressRequest"}, - } - - def __init__( - self, - *, - schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, - datacenter_address_request: Optional["_models.DatacenterAddressRequest"] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_availability_request: Request body to get the availability for scheduling - orders. - :paramtype schedule_availability_request: - ~azure.mgmt.databox.v2021_12_01.models.ScheduleAvailabilityRequest - :keyword transport_availability_request: Request body to get the transport availability for - given sku. - :paramtype transport_availability_request: - ~azure.mgmt.databox.v2021_12_01.models.TransportAvailabilityRequest - :keyword datacenter_address_request: Request body to get the datacenter address for given sku. - :paramtype datacenter_address_request: - ~azure.mgmt.databox.v2021_12_01.models.DatacenterAddressRequest - """ - super().__init__(**kwargs) - self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_request - self.datacenter_address_request = datacenter_address_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.v2021_12_01.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.v2021_12_01.models.TransportAvailabilityResponse - :ivar datacenter_address_response: Datacenter address for given sku in a region. - :vartype datacenter_address_response: - ~azure.mgmt.databox.v2021_12_01.models.DatacenterAddressResponse - """ - - _validation = { - "schedule_availability_response": {"readonly": True}, - "transport_availability_response": {"readonly": True}, - "datacenter_address_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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_response = None - self.datacenter_address_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.v2021_12_01.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.v2021_12_01.models.UserAssignedIdentity] - """ - super().__init__(**kwargs) - self.type = type - self.principal_id = None - self.tenant_id = None - self.user_assigned_identities = user_assigned_identities - - -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.v2021_12_01.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.v2021_12_01.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 Azure. - - :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 Azure. - - :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.v2021_12_01.models.AddressType - """ - - _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"}, - } - - 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", - **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.v2021_12_01.models.AddressType - """ - 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 - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", - and "DataBoxCustomerDisk". - :vartype name: str or ~azure.mgmt.databox.v2021_12_01.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = 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.v2021_12_01.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_12_01.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.v2021_12_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2021_12_01.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 - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - transfer_type: Union[str, "_models.TransferType"], - country: str, - location: str, - **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.v2021_12_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_12_01.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 - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.device_type = device_type - self.transfer_type = transfer_type - self.country = country - self.location = location - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_12_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_12_01.models.CloudError - :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2021_12_01.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 - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = 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.v2021_12_01.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.v2021_12_01.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2021_12_01.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -class StorageAccountDetails(DataAccountDetails): - """Details for the storage account. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_12_01.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): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_12_01.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): - """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 Azure. - - :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.v2021_12_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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 Azure. - - :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.v2021_12_01.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.v2021_12_01.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 Azure. - - :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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.models.TransferAllDetails - """ - super().__init__(**kwargs) - self.include = include - - -class TransferConfigurationTransferFilterDetails(_serialization.Model): - """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.v2021_12_01.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.v2021_12_01.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 Azure. - - :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.v2021_12_01.models.DataAccountType - :ivar blob_filter_details: Filter details to transfer blobs. - :vartype blob_filter_details: ~azure.mgmt.databox.v2021_12_01.models.BlobFilterDetails - :ivar azure_file_filter_details: Filter details to transfer Azure files. - :vartype azure_file_filter_details: - ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.models.DataAccountType - :keyword blob_filter_details: Filter details to transfer blobs. - :paramtype blob_filter_details: ~azure.mgmt.databox.v2021_12_01.models.BlobFilterDetails - :keyword azure_file_filter_details: Filter details to transfer Azure files. - :paramtype azure_file_filter_details: - ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.models.SkuName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = 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.v2021_12_01.models.SkuName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - - -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.v2021_12_01.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. - - All required parameters must be populated in order to send to Azure. - - :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.v2021_12_01.models.TransportShipmentTypes - """ - - _validation = { - "preferred_shipment_type": {"required": True}, - } - - _attribute_map = { - "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, - } - - 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.v2021_12_01.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type - - -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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.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.v2021_12_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :ivar key_encryption_key: Key encryption key for the job. - :vartype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.models.KeyEncryptionKey - :ivar return_to_customer_package_details: Return package details of job. - :vartype return_to_customer_package_details: - ~azure.mgmt.databox.v2021_12_01.models.PackageCarrierDetails - """ - - _attribute_map = { - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "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, - 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.v2021_12_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_12_01.models.ShippingAddress - :keyword key_encryption_key: Key encryption key for the job. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_12_01.models.KeyEncryptionKey - :keyword return_to_customer_package_details: Return package details of job. - :paramtype return_to_customer_package_details: - ~azure.mgmt.databox.v2021_12_01.models.PackageCarrierDetails - """ - super().__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address - 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 Azure. - - :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.v2021_12_01.models.ValidationInputDiscriminator - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.SkuName - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: ~azure.mgmt.databox.v2021_12_01.models.TransportPreferences - """ - - _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"}, - } - - def __init__( - self, - *, - shipping_address: "_models.ShippingAddress", - device_type: Union[str, "_models.SkuName"], - transport_preferences: Optional["_models.TransportPreferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2021_12_01.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.v2021_12_01.models.SkuName - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: ~azure.mgmt.databox.v2021_12_01.models.TransportPreferences - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.shipping_address = shipping_address - self.device_type = device_type - self.transport_preferences = transport_preferences - - -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.v2021_12_01.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.v2021_12_01.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/v2021_12_01/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_data_box_management_client_operations.py deleted file mode 100644 index 4a7112748091..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,210 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2021-12-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 = _format_url_section(_url, **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( # pylint: disable=inconsistent-return-statements - 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.v2021_12_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2021_12_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_jobs_operations.py deleted file mode 100644 index a9ea33461aeb..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_jobs_operations.py +++ /dev/null @@ -1,1731 +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 typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, 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.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .._vendor import DataBoxManagementClientMixinABC, _convert_request, _format_url_section - -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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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.v2021_12_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @overload - def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - 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.v2021_12_01.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @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], - **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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2021_12_01.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.mark_devices_shipped.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-12-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_12_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_12_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_12_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2021_12_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2021-12-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2021-12-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_12_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_12_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_12_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2021_12_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2021_12_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2021_12_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - 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.v2021_12_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2021_12_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_operations.py deleted file mode 100644 index 4480beae538b..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_operations.py +++ /dev/null @@ -1,155 +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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar -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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request - -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(**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", "2021-12-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2021_12_01.DataBoxManagementClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_12_01.models.Operation] - :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", "2021-12-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_service_operations.py deleted file mode 100644 index 4ca7ca0528aa..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_service_operations.py +++ /dev/null @@ -1,1083 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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", "2021-12-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 = _format_url_section(_url, **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.v2021_12_01.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.v2021_12_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_12_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_12_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2021_12_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_12_01.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", "2021-12-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2021_12_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2021_12_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2021_12_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_12_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_12_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2021_12_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2021_12_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2021_12_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2021_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2021-12-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_configuration.py deleted file mode 100644 index ab878ed875c3..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-02-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-02-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_data_box_management_client.py deleted file mode 100644 index 672108e0a0f5..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2022_02_01.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2022_02_01.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2022_02_01.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-02-01". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_metadata.json deleted file mode 100644 index 6ea2711f5443..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "chosen_version": "2022-02-01", - "total_api_version_list": ["2022-02-01"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - }, - "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "sync_mixin_typing_definitions": "", - "async_mixin_typing_definitions": "", - "operations": { - "mitigate" : { - "sync": { - "signature": "def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2022_02_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2022_02_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - } - } - } - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_vendor.py deleted file mode 100644 index ec8d8f6dd7b4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_vendor.py +++ /dev/null @@ -1,48 +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 List, TYPE_CHECKING, cast - -from azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from .._serialization import Deserializer, Serializer - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - -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/v2022_02_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_configuration.py deleted file mode 100644 index f4ceadf9cfcc..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-02-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-02-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_data_box_management_client.py deleted file mode 100644 index 93a6c5fa4f40..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2022_02_01.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2022_02_01.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2022_02_01.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-02-01". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_vendor.py deleted file mode 100644 index 54f3d3ec6541..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_vendor.py +++ /dev/null @@ -1,28 +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 azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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/v2022_02_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_data_box_management_client_operations.py deleted file mode 100644 index 98224f67df95..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,176 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -from ...operations._data_box_management_client_operations import build_mitigate_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC): - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - 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.v2022_02_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2022_02_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_jobs_operations.py deleted file mode 100644 index e335e4040a6d..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1424 +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 typing import Any, AsyncIterable, 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, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2022_02_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @overload - async def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - 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.v2022_02_01.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async 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], - **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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2022_02_01.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.mark_devices_shipped.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_02_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_02_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_02_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2022_02_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2022-02-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_02_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_02_01.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, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_02_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2022_02_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_02_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2022_02_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - 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.v2022_02_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2022_02_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_operations.py deleted file mode 100644 index 5ca5b405a9db..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_operations.py +++ /dev/null @@ -1,135 +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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -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 ..._vendor import _convert_request -from ...operations._operations import build_list_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2022_02_01.aio.DataBoxManagementClient`'s - :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") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_02_01.models.Operation] - :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", "2022-02-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_service_operations.py deleted file mode 100644 index 2b79c20ec4fe..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_service_operations.py +++ /dev/null @@ -1,897 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2022_02_01.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.v2022_02_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_02_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_02_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2022_02_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2022_02_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2022_02_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2022_02_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_02_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_02_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_02_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_02_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2022_02_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/__init__.py deleted file mode 100644 index 37d21054b7d4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/__init__.py +++ /dev/null @@ -1,315 +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 ._models_py3 import AccountCredentialDetails -from ._models_py3 import AdditionalErrorInfo -from ._models_py3 import AddressValidationOutput -from ._models_py3 import AddressValidationProperties -from ._models_py3 import ApiError -from ._models_py3 import ApplianceNetworkConfiguration -from ._models_py3 import ArmBaseObject -from ._models_py3 import AvailableSkuRequest -from ._models_py3 import AvailableSkusResult -from ._models_py3 import AzureFileFilterDetails -from ._models_py3 import BlobFilterDetails -from ._models_py3 import CancellationReason -from ._models_py3 import CloudError -from ._models_py3 import ContactDetails -from ._models_py3 import CopyLogDetails -from ._models_py3 import CopyProgress -from ._models_py3 import CreateJobValidations -from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest -from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties -from ._models_py3 import CustomerDiskJobSecrets -from ._models_py3 import DataAccountDetails -from ._models_py3 import DataBoxAccountCopyLogDetails -from ._models_py3 import DataBoxCustomerDiskCopyLogDetails -from ._models_py3 import DataBoxCustomerDiskCopyProgress -from ._models_py3 import DataBoxCustomerDiskJobDetails -from ._models_py3 import DataBoxDiskCopyLogDetails -from ._models_py3 import DataBoxDiskCopyProgress -from ._models_py3 import DataBoxDiskGranularCopyLogDetails -from ._models_py3 import DataBoxDiskGranularCopyProgress -from ._models_py3 import DataBoxDiskJobDetails -from ._models_py3 import DataBoxDiskJobSecrets -from ._models_py3 import DataBoxHeavyAccountCopyLogDetails -from ._models_py3 import DataBoxHeavyJobDetails -from ._models_py3 import DataBoxHeavyJobSecrets -from ._models_py3 import DataBoxHeavySecret -from ._models_py3 import DataBoxJobDetails -from ._models_py3 import DataBoxScheduleAvailabilityRequest -from ._models_py3 import DataBoxSecret -from ._models_py3 import DataExportDetails -from ._models_py3 import DataImportDetails -from ._models_py3 import DataLocationToServiceLocationMap -from ._models_py3 import DataTransferDetailsValidationRequest -from ._models_py3 import DataTransferDetailsValidationResponseProperties -from ._models_py3 import DataboxJobSecrets -from ._models_py3 import DatacenterAddressInstructionResponse -from ._models_py3 import DatacenterAddressLocationResponse -from ._models_py3 import DatacenterAddressRequest -from ._models_py3 import DatacenterAddressResponse -from ._models_py3 import DcAccessSecurityCode -from ._models_py3 import Details -from ._models_py3 import DeviceErasureDetails -from ._models_py3 import DiskScheduleAvailabilityRequest -from ._models_py3 import DiskSecret -from ._models_py3 import EncryptionPreferences -from ._models_py3 import ErrorDetail -from ._models_py3 import ExportDiskDetails -from ._models_py3 import FilterFileDetails -from ._models_py3 import GranularCopyLogDetails -from ._models_py3 import GranularCopyProgress -from ._models_py3 import HeavyScheduleAvailabilityRequest -from ._models_py3 import IdentityProperties -from ._models_py3 import ImportDiskDetails -from ._models_py3 import JobDeliveryInfo -from ._models_py3 import JobDetails -from ._models_py3 import JobResource -from ._models_py3 import JobResourceList -from ._models_py3 import JobResourceUpdateParameter -from ._models_py3 import JobSecrets -from ._models_py3 import JobStages -from ._models_py3 import KeyEncryptionKey -from ._models_py3 import LastMitigationActionOnJob -from ._models_py3 import ManagedDiskDetails -from ._models_py3 import MarkDevicesShippedRequest -from ._models_py3 import MitigateJobRequest -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import PackageCarrierDetails -from ._models_py3 import PackageCarrierInfo -from ._models_py3 import PackageShippingDetails -from ._models_py3 import Preferences -from ._models_py3 import PreferencesValidationRequest -from ._models_py3 import PreferencesValidationResponseProperties -from ._models_py3 import RegionConfigurationRequest -from ._models_py3 import RegionConfigurationResponse -from ._models_py3 import Resource -from ._models_py3 import ResourceIdentity -from ._models_py3 import ScheduleAvailabilityRequest -from ._models_py3 import ScheduleAvailabilityResponse -from ._models_py3 import ShareCredentialDetails -from ._models_py3 import ShipmentPickUpRequest -from ._models_py3 import ShipmentPickUpResponse -from ._models_py3 import ShippingAddress -from ._models_py3 import Sku -from ._models_py3 import SkuAvailabilityValidationRequest -from ._models_py3 import SkuAvailabilityValidationResponseProperties -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuInformation -from ._models_py3 import StorageAccountDetails -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties -from ._models_py3 import SystemData -from ._models_py3 import TransferAllDetails -from ._models_py3 import TransferConfiguration -from ._models_py3 import TransferConfigurationTransferAllDetails -from ._models_py3 import TransferConfigurationTransferFilterDetails -from ._models_py3 import TransferFilterDetails -from ._models_py3 import TransportAvailabilityDetails -from ._models_py3 import TransportAvailabilityRequest -from ._models_py3 import TransportAvailabilityResponse -from ._models_py3 import TransportPreferences -from ._models_py3 import UnencryptedCredentials -from ._models_py3 import UnencryptedCredentialsList -from ._models_py3 import UpdateJobDetails -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import UserAssignedProperties -from ._models_py3 import ValidateAddress -from ._models_py3 import ValidationInputRequest -from ._models_py3 import ValidationInputResponse -from ._models_py3 import ValidationRequest -from ._models_py3 import ValidationResponse - -from ._data_box_management_client_enums import AccessProtocol -from ._data_box_management_client_enums import AddressType -from ._data_box_management_client_enums import AddressValidationStatus -from ._data_box_management_client_enums import ClassDiscriminator -from ._data_box_management_client_enums import CopyStatus -from ._data_box_management_client_enums import CustomerResolutionCode -from ._data_box_management_client_enums import DataAccountType -from ._data_box_management_client_enums import DataCenterCode -from ._data_box_management_client_enums import DatacenterAddressType -from ._data_box_management_client_enums import DoubleEncryption -from ._data_box_management_client_enums import FilterFileType -from ._data_box_management_client_enums import JobDeliveryType -from ._data_box_management_client_enums import KekType -from ._data_box_management_client_enums import LogCollectionLevel -from ._data_box_management_client_enums import NotificationStageName -from ._data_box_management_client_enums import OverallValidationStatus -from ._data_box_management_client_enums import ShareDestinationFormatType -from ._data_box_management_client_enums import SkuDisabledReason -from ._data_box_management_client_enums import SkuName -from ._data_box_management_client_enums import StageName -from ._data_box_management_client_enums import StageStatus -from ._data_box_management_client_enums import TransferConfigurationType -from ._data_box_management_client_enums import TransferType -from ._data_box_management_client_enums import TransportShipmentTypes -from ._data_box_management_client_enums import ValidationInputDiscriminator -from ._data_box_management_client_enums import ValidationStatus -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccountCredentialDetails", - "AdditionalErrorInfo", - "AddressValidationOutput", - "AddressValidationProperties", - "ApiError", - "ApplianceNetworkConfiguration", - "ArmBaseObject", - "AvailableSkuRequest", - "AvailableSkusResult", - "AzureFileFilterDetails", - "BlobFilterDetails", - "CancellationReason", - "CloudError", - "ContactDetails", - "CopyLogDetails", - "CopyProgress", - "CreateJobValidations", - "CreateOrderLimitForSubscriptionValidationRequest", - "CreateOrderLimitForSubscriptionValidationResponseProperties", - "CustomerDiskJobSecrets", - "DataAccountDetails", - "DataBoxAccountCopyLogDetails", - "DataBoxCustomerDiskCopyLogDetails", - "DataBoxCustomerDiskCopyProgress", - "DataBoxCustomerDiskJobDetails", - "DataBoxDiskCopyLogDetails", - "DataBoxDiskCopyProgress", - "DataBoxDiskGranularCopyLogDetails", - "DataBoxDiskGranularCopyProgress", - "DataBoxDiskJobDetails", - "DataBoxDiskJobSecrets", - "DataBoxHeavyAccountCopyLogDetails", - "DataBoxHeavyJobDetails", - "DataBoxHeavyJobSecrets", - "DataBoxHeavySecret", - "DataBoxJobDetails", - "DataBoxScheduleAvailabilityRequest", - "DataBoxSecret", - "DataExportDetails", - "DataImportDetails", - "DataLocationToServiceLocationMap", - "DataTransferDetailsValidationRequest", - "DataTransferDetailsValidationResponseProperties", - "DataboxJobSecrets", - "DatacenterAddressInstructionResponse", - "DatacenterAddressLocationResponse", - "DatacenterAddressRequest", - "DatacenterAddressResponse", - "DcAccessSecurityCode", - "Details", - "DeviceErasureDetails", - "DiskScheduleAvailabilityRequest", - "DiskSecret", - "EncryptionPreferences", - "ErrorDetail", - "ExportDiskDetails", - "FilterFileDetails", - "GranularCopyLogDetails", - "GranularCopyProgress", - "HeavyScheduleAvailabilityRequest", - "IdentityProperties", - "ImportDiskDetails", - "JobDeliveryInfo", - "JobDetails", - "JobResource", - "JobResourceList", - "JobResourceUpdateParameter", - "JobSecrets", - "JobStages", - "KeyEncryptionKey", - "LastMitigationActionOnJob", - "ManagedDiskDetails", - "MarkDevicesShippedRequest", - "MitigateJobRequest", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationList", - "PackageCarrierDetails", - "PackageCarrierInfo", - "PackageShippingDetails", - "Preferences", - "PreferencesValidationRequest", - "PreferencesValidationResponseProperties", - "RegionConfigurationRequest", - "RegionConfigurationResponse", - "Resource", - "ResourceIdentity", - "ScheduleAvailabilityRequest", - "ScheduleAvailabilityResponse", - "ShareCredentialDetails", - "ShipmentPickUpRequest", - "ShipmentPickUpResponse", - "ShippingAddress", - "Sku", - "SkuAvailabilityValidationRequest", - "SkuAvailabilityValidationResponseProperties", - "SkuCapacity", - "SkuCost", - "SkuInformation", - "StorageAccountDetails", - "SubscriptionIsAllowedToCreateJobValidationRequest", - "SubscriptionIsAllowedToCreateJobValidationResponseProperties", - "SystemData", - "TransferAllDetails", - "TransferConfiguration", - "TransferConfigurationTransferAllDetails", - "TransferConfigurationTransferFilterDetails", - "TransferFilterDetails", - "TransportAvailabilityDetails", - "TransportAvailabilityRequest", - "TransportAvailabilityResponse", - "TransportPreferences", - "UnencryptedCredentials", - "UnencryptedCredentialsList", - "UpdateJobDetails", - "UserAssignedIdentity", - "UserAssignedProperties", - "ValidateAddress", - "ValidationInputRequest", - "ValidationInputResponse", - "ValidationRequest", - "ValidationResponse", - "AccessProtocol", - "AddressType", - "AddressValidationStatus", - "ClassDiscriminator", - "CopyStatus", - "CustomerResolutionCode", - "DataAccountType", - "DataCenterCode", - "DatacenterAddressType", - "DoubleEncryption", - "FilterFileType", - "JobDeliveryType", - "KekType", - "LogCollectionLevel", - "NotificationStageName", - "OverallValidationStatus", - "ShareDestinationFormatType", - "SkuDisabledReason", - "SkuName", - "StageName", - "StageStatus", - "TransferConfigurationType", - "TransferType", - "TransportShipmentTypes", - "ValidationInputDiscriminator", - "ValidationStatus", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_data_box_management_client_enums.py deleted file mode 100644 index b7123fbe1d79..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_data_box_management_client_enums.py +++ /dev/null @@ -1,450 +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 enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" - - SMB = "SMB" - """Server Message Block protocol(SMB).""" - NFS = "NFS" - """Network File System protocol(NFS).""" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The address validation status.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the type of job details.""" - - DATA_BOX = "DataBox" - """Data Box orders.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk orders.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy orders.""" - DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk orders.""" - - -class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Status of the copy.""" - - NOT_STARTED = "NotStarted" - """Data copy hasn't started yet.""" - IN_PROGRESS = "InProgress" - """Data copy is in progress.""" - COMPLETED = "Completed" - """Data copy completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Data copy completed with errors.""" - FAILED = "Failed" - """Data copy failed. No data was copied.""" - NOT_RETURNED = "NotReturned" - """No copy triggered as device was not returned.""" - HARDWARE_ERROR = "HardwareError" - """The Device has hit hardware issues.""" - DEVICE_FORMATTED = "DeviceFormatted" - """Data copy failed. The Device was formatted by user.""" - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" - """Data copy failed. Device metadata was modified by user.""" - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" - """Data copy failed. Storage Account was not accessible during copy.""" - UNSUPPORTED_DATA = "UnsupportedData" - """Data copy failed. The Device data content is not supported.""" - DRIVE_NOT_RECEIVED = "DriveNotReceived" - """No copy triggered as device was not received.""" - UNSUPPORTED_DRIVE = "UnsupportedDrive" - """No copy triggered as device type is not supported.""" - OTHER_SERVICE_ERROR = "OtherServiceError" - """Copy failed due to service error.""" - OTHER_USER_ERROR = "OtherUserError" - """Copy failed due to user error.""" - DRIVE_NOT_DETECTED = "DriveNotDetected" - """Copy failed due to disk detection error.""" - DRIVE_CORRUPTED = "DriveCorrupted" - """Copy failed due to corrupted drive.""" - METADATA_FILES_MODIFIED_OR_REMOVED = "MetadataFilesModifiedOrRemoved" - """Copy failed due to modified or removed metadata files.""" - - -class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """CustomerResolutionCode.""" - - NONE = "None" - """No Resolution Yet""" - MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" - """Clean the device""" - RESUME = "Resume" - """Resume the job to same stage""" - RESTART = "Restart" - """Restart whole action.""" - REACH_OUT_TO_OPERATION = "ReachOutToOperation" - """Reach out to operation for further action.""" - - -class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the account.""" - - STORAGE_ACCOUNT = "StorageAccount" - """Storage Accounts .""" - MANAGED_DISK = "ManagedDisk" - """Azure Managed disk storage.""" - - -class DatacenterAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data center address type.""" - - DATACENTER_ADDRESS_LOCATION = "DatacenterAddressLocation" - """Data center address location.""" - DATACENTER_ADDRESS_INSTRUCTION = "DatacenterAddressInstruction" - """Data center address instruction.""" - - -class DataCenterCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DataCenter code.""" - - INVALID = "Invalid" - BY2 = "BY2" - BY1 = "BY1" - ORK70 = "ORK70" - AM2 = "AM2" - AMS20 = "AMS20" - BY21 = "BY21" - BY24 = "BY24" - MWH01 = "MWH01" - AMS06 = "AMS06" - SSE90 = "SSE90" - SYD03 = "SYD03" - SYD23 = "SYD23" - CBR20 = "CBR20" - YTO20 = "YTO20" - CWL20 = "CWL20" - LON24 = "LON24" - BOM01 = "BOM01" - BL20 = "BL20" - BL7 = "BL7" - SEL20 = "SEL20" - TYO01 = "TYO01" - BN1 = "BN1" - SN5 = "SN5" - CYS04 = "CYS04" - TYO22 = "TYO22" - YTO21 = "YTO21" - YQB20 = "YQB20" - FRA22 = "FRA22" - MAA01 = "MAA01" - CPQ02 = "CPQ02" - CPQ20 = "CPQ20" - SIN20 = "SIN20" - HKG20 = "HKG20" - SG2 = "SG2" - MEL23 = "MEL23" - SEL21 = "SEL21" - OSA20 = "OSA20" - SHA03 = "SHA03" - BJB = "BJB" - JNB22 = "JNB22" - JNB21 = "JNB21" - MNZ21 = "MNZ21" - SN8 = "SN8" - AUH20 = "AUH20" - ZRH20 = "ZRH20" - PUS20 = "PUS20" - AD_HOC = "AdHoc" - CH1 = "CH1" - DSM05 = "DSM05" - DUB07 = "DUB07" - PNQ01 = "PNQ01" - SVG20 = "SVG20" - OSA02 = "OSA02" - OSA22 = "OSA22" - PAR22 = "PAR22" - BN7 = "BN7" - SN6 = "SN6" - BJS20 = "BJS20" - - -class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines secondary layer of software-based encryption enablement.""" - - ENABLED = "Enabled" - """Software-based encryption is enabled.""" - DISABLED = "Disabled" - """Software-based encryption is disabled.""" - - -class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the filter file.""" - - AZURE_BLOB = "AzureBlob" - """Filter file is of the type AzureBlob.""" - AZURE_FILE = "AzureFile" - """Filter file is of the type AzureFiles.""" - - -class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Delivery type of Job.""" - - NON_SCHEDULED = "NonScheduled" - """Non Scheduled job.""" - SCHEDULED = "Scheduled" - """Scheduled job.""" - - -class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of encryption key used for key encryption.""" - - MICROSOFT_MANAGED = "MicrosoftManaged" - """Key encryption key is managed by Microsoft.""" - CUSTOMER_MANAGED = "CustomerManaged" - """Key encryption key is managed by the Customer.""" - - -class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of the logs to be collected.""" - - ERROR = "Error" - """Only Errors will be collected in the logs.""" - VERBOSE = "Verbose" - """Verbose logging (includes Errors, CRC, size information and others).""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - DEVICE_PREPARED = "DevicePrepared" - """Notification at device prepared stage.""" - DISPATCHED = "Dispatched" - """Notification at device dispatched stage.""" - DELIVERED = "Delivered" - """Notification at device delivered stage.""" - PICKED_UP = "PickedUp" - """Notification at device picked up from user stage.""" - AT_AZURE_DC = "AtAzureDC" - """Notification at device received at Azure datacenter stage.""" - DATA_COPY = "DataCopy" - """Notification at data copy started stage.""" - CREATED = "Created" - """Notification at job created stage.""" - SHIPPED_TO_CUSTOMER = "ShippedToCustomer" - """Notification at shipped devices to customer stage.""" - - -class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall validation status.""" - - ALL_VALID_TO_PROCEED = "AllValidToProceed" - """Every input request is valid.""" - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" - """Some input requests are not valid.""" - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" - """Certain input validations skipped.""" - - -class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the share.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown format.""" - HCS = "HCS" - """Storsimple data format.""" - BLOCK_BLOB = "BlockBlob" - """Azure storage block blob format.""" - PAGE_BLOB = "PageBlob" - """Azure storage page blob format.""" - AZURE_FILE = "AzureFile" - """Azure storage file format.""" - MANAGED_DISK = "ManagedDisk" - """Azure Compute Disk.""" - - -class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the Sku is disabled.""" - - NONE = "None" - """SKU is not disabled.""" - COUNTRY = "Country" - """SKU is not available in the requested country.""" - REGION = "Region" - """SKU is not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled for the SKU.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types for the SKU.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" - - DATA_BOX = "DataBox" - """Data Box.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy.""" - DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk""" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage which is in progress.""" - - DEVICE_ORDERED = "DeviceOrdered" - """An order has been created.""" - DEVICE_PREPARED = "DevicePrepared" - """A device has been prepared for the order.""" - DISPATCHED = "Dispatched" - """Device has been dispatched to the user of the order.""" - DELIVERED = "Delivered" - """Device has been delivered to the user of the order.""" - PICKED_UP = "PickedUp" - """Device has been picked up from user and in transit to Azure datacenter.""" - AT_AZURE_DC = "AtAzureDC" - """Device has been received at Azure datacenter from the user.""" - DATA_COPY = "DataCopy" - """Data copy from the device at Azure datacenter.""" - COMPLETED = "Completed" - """Order has completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Order has completed with errors.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" - """Order has failed due to issue reported by user.""" - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" - """Order has failed due to issue detected at Azure datacenter.""" - ABORTED = "Aborted" - """Order has been aborted.""" - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - """Order has completed with warnings.""" - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" - """Device is ready to be handed to customer from Azure DC.""" - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" - """Device can be dropped off at Azure DC.""" - CREATED = "Created" - """Job created by the customer.""" - SHIPPED_TO_AZURE_DC = "ShippedToAzureDC" - """User shipped the device to AzureDC.""" - AWAITING_SHIPMENT_DETAILS = "AwaitingShipmentDetails" - """Awaiting shipment details of device from customer.""" - PREPARING_TO_SHIP_FROM_AZURE_DC = "PreparingToShipFromAzureDC" - """Preparing the device to ship to customer.""" - SHIPPED_TO_CUSTOMER = "ShippedToCustomer" - """Shipped the device to customer.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Holds the device erasure completion status.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" - """Stage has succeeded with errors.""" - WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" - """Stage is stuck until customer takes some action.""" - SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" - """Stage has succeeded with warnings.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" - """Stage is waiting for customer action for kek action items.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" - """Stage is waiting for customer action for clean up.""" - CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" - """Stage has performed customer action for clean up.""" - CUSTOMER_ACTION_PERFORMED = "CustomerActionPerformed" - """Stage has performed customer action for clean up.""" - - -class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the configuration for transfer.""" - - TRANSFER_ALL = "TransferAll" - """Transfer all the data.""" - TRANSFER_USING_FILTER = "TransferUsingFilter" - """Transfer using filter.""" - - -class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the transfer.""" - - IMPORT_TO_AZURE = "ImportToAzure" - """Import data to azure.""" - EXPORT_FROM_AZURE = "ExportFromAzure" - """Export data from azure.""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Transport Shipment Type supported for given region.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Identifies the type of validation request.""" - - VALIDATE_ADDRESS = "ValidateAddress" - """Identify request and response of address validation.""" - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" - """Identify request and response for validation of subscription permission to create job.""" - VALIDATE_PREFERENCES = "ValidatePreferences" - """Identify request and response of preference validation.""" - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" - """Identify request and response of create order limit for subscription validation.""" - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" - """Identify request and response of active job limit for sku availability.""" - VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" - """Identify request and response of data transfer details validation.""" - - -class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Create order limit validation status.""" - - VALID = "Valid" - """Validation is successful""" - INVALID = "Invalid" - """Validation is not successful""" - SKIPPED = "Skipped" - """Validation is skipped""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_models_py3.py deleted file mode 100644 index 7351f8f6f062..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_models_py3.py +++ /dev/null @@ -1,6117 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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, 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 # pylint: disable=ungrouped-imports -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_02_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2022_02_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2022_02_01.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 Azure. - - :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.v2022_02_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_02_01.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 Azure. - - :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.v2022_02_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_02_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2022_02_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2022_02_01.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 Azure. - - :ivar error: Required. - :vartype error: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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 Azure. - - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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 Azure. - - :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.v2022_02_01.models.AdditionalErrorInfo] - :ivar code: Error code. - :vartype code: str - :ivar details: Gets or sets details for the error. - :vartype details: list[~azure.mgmt.databox.v2022_02_01.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 Azure. - - :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.v2022_02_01.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.v2022_02_01.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 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 Azure. - - :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.v2022_02_01.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): # pylint: disable=too-many-instance-attributes - """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.v2022_02_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_02_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -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 Azure. - - :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.v2022_02_01.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.v2022_02_01.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 Azure. - - :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.v2022_02_01.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.v2022_02_01.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 Azure. - - :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.v2022_02_01.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): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_02_01.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.v2022_02_01.models.SkuName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - } - - def __init__(self, *, device_type: Union[str, "_models.SkuName"], **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.v2022_02_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.device_type = device_type - - -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_02_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_02_01.models.CloudError - :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2022_02_01.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 Azure. - - :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.v2022_02_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_02_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_02_01.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 Azure. - - :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.v2022_02_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_02_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_02_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2022_02_01.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 Azure. - - :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.v2022_02_01.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 Azure. - - :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.v2022_02_01.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 Azure. - - :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.v2022_02_01.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): # pylint: disable=too-many-instance-attributes - """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.v2022_02_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_02_01.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 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.v2022_02_01.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}, - "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"}, - "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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_02_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_02_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_02_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_02_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_02_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_02_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_02_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_02_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_02_01.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"}, - "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, - 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.v2022_02_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_02_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_02_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_02_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.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.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_02_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_02_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_02_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_02_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_02_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_02_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_02_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_02_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.models.ExportDiskDetails] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: - list[~azure.mgmt.databox.v2022_02_01.models.DataBoxCustomerDiskCopyProgress] - :ivar deliver_to_dc_package_details: Delivery package shipping details. - :vartype deliver_to_dc_package_details: - ~azure.mgmt.databox.v2022_02_01.models.PackageCarrierInfo - :ivar return_to_customer_package_details: Return package shipping details. Required. - :vartype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_02_01.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"}, - "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, - 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.v2022_02_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_02_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_02_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_02_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.ImportDiskDetails] - :keyword return_to_customer_package_details: Return package shipping details. Required. - :paramtype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_02_01.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, - 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 Azure. - - :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.v2022_02_01.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.v2022_02_01.models.CopyStatus - """ - - _validation = { - "serial_number": {"readonly": True}, - "bytes_copied": {"readonly": True}, - "percent_complete": {"readonly": True}, - "status": {"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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = 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 Azure. - - :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.v2022_02_01.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 Azure. - - :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.v2022_02_01.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): # pylint: disable=too-many-instance-attributes - """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.v2022_02_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_02_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -class DataBoxDiskGranularCopyProgress(GranularCopyProgress): # pylint: disable=too-many-instance-attributes - """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.v2022_02_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_02_01.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 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.v2022_02_01.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}, - "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"}, - "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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_02_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_02_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_02_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_02_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_02_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_02_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_02_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_02_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.DataBoxDiskCopyProgress] - :ivar granular_copy_progress: Copy progress per disk. - :vartype granular_copy_progress: - list[~azure.mgmt.databox.v2022_02_01.models.DataBoxDiskGranularCopyProgress] - :ivar granular_copy_log_details: Copy progress per disk. - :vartype granular_copy_log_details: - list[~azure.mgmt.databox.v2022_02_01.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"}, - "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, - 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.v2022_02_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_02_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_02_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_02_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.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, - 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 Azure. - - :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.v2022_02_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_02_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_02_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2022_02_01.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 Azure. - - :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.v2022_02_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_02_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_02_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_02_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_02_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_02_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_02_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_02_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_02_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_02_01.models.DataCenterCode - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.v2022_02_01.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"}, - "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, - 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.v2022_02_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_02_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_02_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_02_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.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, - 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 Azure. - - :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.v2022_02_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_02_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_02_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_02_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_02_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_02_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_02_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_02_01.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_02_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_02_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_02_01.models.DataCenterCode - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.v2022_02_01.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"}, - "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, - 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.v2022_02_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_02_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_02_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_02_01.models.Preferences - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.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, - 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 Azure. - - :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.v2022_02_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_02_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_02_01.models.CloudError - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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 Azure. - - :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.v2022_02_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - _subtype_map = { - "sku_name": { - "DataBox": "DataBoxScheduleAvailabilityRequest", - "DataBoxDisk": "DiskScheduleAvailabilityRequest", - "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", - } - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name: Optional[str] = None - self.country = country - - -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 Azure. - - :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.v2022_02_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2022_02_01.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.v2022_02_01.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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2022_02_01.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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2022_02_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2022_02_01.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 Azure. - - :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.v2022_02_01.models.SkuName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, storage_location: str, sku_name: Union[str, "_models.SkuName"], **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.v2022_02_01.models.SkuName - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name = sku_name - - -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 Azure. - - :ivar transfer_configuration: Configuration for the data transfer. Required. - :vartype transfer_configuration: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.LogCollectionLevel - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.models.LogCollectionLevel - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2022_02_01.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 Azure. - - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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 Azure. - - :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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.models.DataImportDetails] - :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype device_type: str or ~azure.mgmt.databox.v2022_02_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2022_02_01.models.TransferType - """ - - _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"}, - } - - 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, - **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.v2022_02_01.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.v2022_02_01.models.DataImportDetails] - :keyword device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype device_type: str or ~azure.mgmt.databox.v2022_02_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2022_02_01.models.TransferType - """ - 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 - - -class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): - """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 Azure. - - :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.v2022_02_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_02_01.models.CloudError - :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", - and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2022_02_01.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 Azure. - - :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 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.v2022_02_01.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 Azure. - - :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.v2022_02_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :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"}, - "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, - **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 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, **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.v2022_02_01.models.DoubleEncryption - """ - - _attribute_map = { - "double_encryption": {"key": "doubleEncryption", "type": "str"}, - } - - def __init__( - self, *, double_encryption: Union[str, "_models.DoubleEncryption"] = "Disabled", **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.v2022_02_01.models.DoubleEncryption - """ - super().__init__(**kwargs) - self.double_encryption = double_encryption - - -class ErrorDetail(_serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to Azure. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar details: - :vartype details: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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 Azure. - - :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.v2022_02_01.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.v2022_02_01.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 Azure. - - :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.v2022_02_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2022_02_01.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.v2022_02_01.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 Azure. - - :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 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 Azure. - - :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.v2022_02_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2022_02_01.models.ResourceIdentity - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - self.identity = identity - - -class JobResource(Resource): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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.v2022_02_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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 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.v2022_02_01.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.v2022_02_01.models.CloudError - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.JobDeliveryType - :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.v2022_02_01.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: 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}, - "is_prepare_to_ship_enabled": {"readonly": True}, - "status": {"readonly": True}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "is_cancellable_without_fee": {"readonly": True}, - } - - _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"}, - "is_prepare_to_ship_enabled": {"key": "properties.isPrepareToShipEnabled", "type": "bool"}, - "status": {"key": "properties.status", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "error": {"key": "properties.error", "type": "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"}, - } - - def __init__( - 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.v2022_02_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.TransferType - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.v2022_02_01.models.JobDetails - :keyword delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :paramtype delivery_type: str or ~azure.mgmt.databox.v2022_02_01.models.JobDeliveryType - :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.v2022_02_01.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.is_prepare_to_ship_enabled = None - self.status = None - self.start_time = None - self.error = None - self.details = details - self.cancellation_reason = None - self.delivery_type = delivery_type - self.delivery_info = delivery_info - self.is_cancellable_without_fee = None - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.models.ResourceIdentity - :ivar details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.ResourceIdentity - :keyword details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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 - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"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"}, - } - - 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 - - -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 Azure. - - :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.v2022_02_01.models.KekType - :ivar identity_properties: Managed identity properties used for key encryption. - :vartype identity_properties: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.KekType - :keyword identity_properties: Managed identity properties used for key encryption. - :paramtype identity_properties: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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 Azure. - - :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.v2022_02_01.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 Azure. - - :ivar deliver_to_dc_package_details: Delivery package details. Required. - :vartype deliver_to_dc_package_details: - ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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. - - All required parameters must be populated in order to send to Azure. - - :ivar customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". - :vartype customer_resolution_code: str or - ~azure.mgmt.databox.v2022_02_01.models.CustomerResolutionCode - """ - - _validation = { - "customer_resolution_code": {"required": True}, - } - - _attribute_map = { - "customer_resolution_code": {"key": "customerResolutionCode", "type": "str"}, - } - - def __init__( - self, *, customer_resolution_code: Union[str, "_models.CustomerResolutionCode"], **kwargs: Any - ) -> None: - """ - :keyword customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". - :paramtype customer_resolution_code: str or - ~azure.mgmt.databox.v2022_02_01.models.CustomerResolutionCode - """ - super().__init__(**kwargs) - self.customer_resolution_code = customer_resolution_code - - -class NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: ~azure.mgmt.databox.v2022_02_01.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"}, - "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, - 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.v2022_02_01.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: ~azure.mgmt.databox.v2022_02_01.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.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 Azure. - - :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.v2022_02_01.models.ValidationInputDiscriminator - :ivar preference: Preference of transport and data center. - :vartype preference: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.SkuName - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - preference: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: Preference of transport and data center. - :paramtype preference: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.preference = preference - self.device_type = device_type - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_02_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.models.ScheduleAvailabilityRequest - :ivar transport_availability_request: Request body to get the transport availability for given - sku. - :vartype transport_availability_request: - ~azure.mgmt.databox.v2022_02_01.models.TransportAvailabilityRequest - :ivar datacenter_address_request: Request body to get the datacenter address for given sku. - :vartype datacenter_address_request: - ~azure.mgmt.databox.v2022_02_01.models.DatacenterAddressRequest - """ - - _attribute_map = { - "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, - "transport_availability_request": { - "key": "transportAvailabilityRequest", - "type": "TransportAvailabilityRequest", - }, - "datacenter_address_request": {"key": "datacenterAddressRequest", "type": "DatacenterAddressRequest"}, - } - - def __init__( - self, - *, - schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, - datacenter_address_request: Optional["_models.DatacenterAddressRequest"] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_availability_request: Request body to get the availability for scheduling - orders. - :paramtype schedule_availability_request: - ~azure.mgmt.databox.v2022_02_01.models.ScheduleAvailabilityRequest - :keyword transport_availability_request: Request body to get the transport availability for - given sku. - :paramtype transport_availability_request: - ~azure.mgmt.databox.v2022_02_01.models.TransportAvailabilityRequest - :keyword datacenter_address_request: Request body to get the datacenter address for given sku. - :paramtype datacenter_address_request: - ~azure.mgmt.databox.v2022_02_01.models.DatacenterAddressRequest - """ - super().__init__(**kwargs) - self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_request - self.datacenter_address_request = datacenter_address_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.v2022_02_01.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.v2022_02_01.models.TransportAvailabilityResponse - :ivar datacenter_address_response: Datacenter address for given sku in a region. - :vartype datacenter_address_response: - ~azure.mgmt.databox.v2022_02_01.models.DatacenterAddressResponse - """ - - _validation = { - "schedule_availability_response": {"readonly": True}, - "transport_availability_response": {"readonly": True}, - "datacenter_address_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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_response = None - self.datacenter_address_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.v2022_02_01.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.v2022_02_01.models.UserAssignedIdentity] - """ - super().__init__(**kwargs) - self.type = type - self.principal_id = None - self.tenant_id = None - self.user_assigned_identities = user_assigned_identities - - -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.v2022_02_01.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.v2022_02_01.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 Azure. - - :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 Azure. - - :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.v2022_02_01.models.AddressType - """ - - _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"}, - } - - 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", - **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.v2022_02_01.models.AddressType - """ - 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 - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", - and "DataBoxCustomerDisk". - :vartype name: str or ~azure.mgmt.databox.v2022_02_01.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = 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.v2022_02_01.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_02_01.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.v2022_02_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2022_02_01.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 - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - transfer_type: Union[str, "_models.TransferType"], - country: str, - location: str, - **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.v2022_02_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2022_02_01.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 - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.device_type = device_type - self.transfer_type = transfer_type - self.country = country - self.location = location - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_02_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_02_01.models.CloudError - :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2022_02_01.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 - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = 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.v2022_02_01.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.v2022_02_01.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2022_02_01.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -class StorageAccountDetails(DataAccountDetails): - """Details for the storage account. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_02_01.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): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_02_01.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): - """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 Azure. - - :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.v2022_02_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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 Azure. - - :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.v2022_02_01.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.v2022_02_01.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 Azure. - - :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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.models.TransferAllDetails - """ - super().__init__(**kwargs) - self.include = include - - -class TransferConfigurationTransferFilterDetails(_serialization.Model): - """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.v2022_02_01.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.v2022_02_01.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 Azure. - - :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.v2022_02_01.models.DataAccountType - :ivar blob_filter_details: Filter details to transfer blobs. - :vartype blob_filter_details: ~azure.mgmt.databox.v2022_02_01.models.BlobFilterDetails - :ivar azure_file_filter_details: Filter details to transfer Azure files. - :vartype azure_file_filter_details: - ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.models.DataAccountType - :keyword blob_filter_details: Filter details to transfer blobs. - :paramtype blob_filter_details: ~azure.mgmt.databox.v2022_02_01.models.BlobFilterDetails - :keyword azure_file_filter_details: Filter details to transfer Azure files. - :paramtype azure_file_filter_details: - ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.models.SkuName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = 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.v2022_02_01.models.SkuName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - - -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.v2022_02_01.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. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_02_01.models.TransportShipmentTypes - """ - - _validation = { - "preferred_shipment_type": {"required": True}, - } - - _attribute_map = { - "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, - } - - 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.v2022_02_01.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type - - -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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.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.v2022_02_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :ivar key_encryption_key: Key encryption key for the job. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.models.KeyEncryptionKey - :ivar return_to_customer_package_details: Return package details of job. - :vartype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_02_01.models.PackageCarrierDetails - """ - - _attribute_map = { - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "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, - 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.v2022_02_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_02_01.models.ShippingAddress - :keyword key_encryption_key: Key encryption key for the job. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_02_01.models.KeyEncryptionKey - :keyword return_to_customer_package_details: Return package details of job. - :paramtype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_02_01.models.PackageCarrierDetails - """ - super().__init__(**kwargs) - self.contact_details = contact_details - self.shipping_address = shipping_address - 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 Azure. - - :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.v2022_02_01.models.ValidationInputDiscriminator - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.SkuName - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: ~azure.mgmt.databox.v2022_02_01.models.TransportPreferences - """ - - _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"}, - } - - def __init__( - self, - *, - shipping_address: "_models.ShippingAddress", - device_type: Union[str, "_models.SkuName"], - transport_preferences: Optional["_models.TransportPreferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_02_01.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.v2022_02_01.models.SkuName - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: ~azure.mgmt.databox.v2022_02_01.models.TransportPreferences - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.shipping_address = shipping_address - self.device_type = device_type - self.transport_preferences = transport_preferences - - -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.v2022_02_01.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.v2022_02_01.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/v2022_02_01/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_data_box_management_client_operations.py deleted file mode 100644 index 459ae9506465..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,210 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2022-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 = _format_url_section(_url, **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( # pylint: disable=inconsistent-return-statements - 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.v2022_02_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2022_02_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_jobs_operations.py deleted file mode 100644 index af4d660d9695..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_jobs_operations.py +++ /dev/null @@ -1,1731 +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 typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, 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.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .._vendor import DataBoxManagementClientMixinABC, _convert_request, _format_url_section - -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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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.v2022_02_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @overload - def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - 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.v2022_02_01.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @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], - **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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2022_02_01.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.mark_devices_shipped.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_02_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_02_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_02_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2022_02_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2022-02-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_02_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_02_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_02_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2022_02_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_02_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2022_02_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - 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.v2022_02_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2022_02_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_operations.py deleted file mode 100644 index 75612938ade1..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_operations.py +++ /dev/null @@ -1,155 +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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar -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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request - -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(**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", "2022-02-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2022_02_01.DataBoxManagementClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_02_01.models.Operation] - :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", "2022-02-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_service_operations.py deleted file mode 100644 index 1abb0c2b10be..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_service_operations.py +++ /dev/null @@ -1,1083 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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", "2022-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 = _format_url_section(_url, **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.v2022_02_01.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.v2022_02_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_02_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_02_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2022_02_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_02_01.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", "2022-02-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2022_02_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2022_02_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2022_02_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_02_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_02_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_02_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_02_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2022_02_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_02_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-02-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_configuration.py deleted file mode 100644 index 72824de57877..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-09-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-09-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_data_box_management_client.py deleted file mode 100644 index 12a9ae472094..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2022_09_01.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2022_09_01.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2022_09_01.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-09-01". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_metadata.json deleted file mode 100644 index 879373027b55..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "chosen_version": "2022-09-01", - "total_api_version_list": ["2022-09-01"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - }, - "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "sync_mixin_typing_definitions": "", - "async_mixin_typing_definitions": "", - "operations": { - "mitigate" : { - "sync": { - "signature": "def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2022_09_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2022_09_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - } - } - } - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_vendor.py deleted file mode 100644 index ec8d8f6dd7b4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_vendor.py +++ /dev/null @@ -1,48 +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 List, TYPE_CHECKING, cast - -from azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from .._serialization import Deserializer, Serializer - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - -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/v2022_09_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_configuration.py deleted file mode 100644 index 582d06ee4ef3..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-09-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-09-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_data_box_management_client.py deleted file mode 100644 index c58d4a2be848..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2022_09_01.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2022_09_01.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2022_09_01.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-09-01". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_vendor.py deleted file mode 100644 index 54f3d3ec6541..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/_vendor.py +++ /dev/null @@ -1,28 +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 azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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/v2022_09_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_data_box_management_client_operations.py deleted file mode 100644 index e489342faa0d..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,176 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -from ...operations._data_box_management_client_operations import build_mitigate_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC): - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - 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.v2022_09_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2022_09_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_jobs_operations.py deleted file mode 100644 index 31e4d866e35f..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1432 +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 typing import Any, AsyncIterable, 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, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2022_09_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @overload - async def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - 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.v2022_09_01.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async 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], - **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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2022_09_01.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.mark_devices_shipped.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_09_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_09_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_09_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2022_09_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2022-09-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_09_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_09_01.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, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_09_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2022_09_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_09_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2022_09_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - 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.v2022_09_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2022_09_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_operations.py deleted file mode 100644 index d768d9798c7e..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_operations.py +++ /dev/null @@ -1,135 +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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -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 ..._vendor import _convert_request -from ...operations._operations import build_list_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2022_09_01.aio.DataBoxManagementClient`'s - :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") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_09_01.models.Operation] - :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", "2022-09-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_service_operations.py deleted file mode 100644 index ee5e433f777a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/aio/operations/_service_operations.py +++ /dev/null @@ -1,897 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2022_09_01.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.v2022_09_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_09_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2022_09_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2022_09_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2022_09_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2022_09_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_09_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_09_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_09_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_09_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2022_09_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/__init__.py deleted file mode 100644 index 6cdca764f767..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/__init__.py +++ /dev/null @@ -1,323 +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 ._models_py3 import AccountCredentialDetails -from ._models_py3 import AdditionalErrorInfo -from ._models_py3 import AddressValidationOutput -from ._models_py3 import AddressValidationProperties -from ._models_py3 import ApiError -from ._models_py3 import ApplianceNetworkConfiguration -from ._models_py3 import ArmBaseObject -from ._models_py3 import AvailableSkuRequest -from ._models_py3 import AvailableSkusResult -from ._models_py3 import AzureFileFilterDetails -from ._models_py3 import BlobFilterDetails -from ._models_py3 import CancellationReason -from ._models_py3 import CloudError -from ._models_py3 import ContactDetails -from ._models_py3 import ContactInfo -from ._models_py3 import CopyLogDetails -from ._models_py3 import CopyProgress -from ._models_py3 import CreateJobValidations -from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest -from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties -from ._models_py3 import CustomerDiskJobSecrets -from ._models_py3 import DataAccountDetails -from ._models_py3 import DataBoxAccountCopyLogDetails -from ._models_py3 import DataBoxCustomerDiskCopyLogDetails -from ._models_py3 import DataBoxCustomerDiskCopyProgress -from ._models_py3 import DataBoxCustomerDiskJobDetails -from ._models_py3 import DataBoxDiskCopyLogDetails -from ._models_py3 import DataBoxDiskCopyProgress -from ._models_py3 import DataBoxDiskGranularCopyLogDetails -from ._models_py3 import DataBoxDiskGranularCopyProgress -from ._models_py3 import DataBoxDiskJobDetails -from ._models_py3 import DataBoxDiskJobSecrets -from ._models_py3 import DataBoxHeavyAccountCopyLogDetails -from ._models_py3 import DataBoxHeavyJobDetails -from ._models_py3 import DataBoxHeavyJobSecrets -from ._models_py3 import DataBoxHeavySecret -from ._models_py3 import DataBoxJobDetails -from ._models_py3 import DataBoxScheduleAvailabilityRequest -from ._models_py3 import DataBoxSecret -from ._models_py3 import DataExportDetails -from ._models_py3 import DataImportDetails -from ._models_py3 import DataLocationToServiceLocationMap -from ._models_py3 import DataTransferDetailsValidationRequest -from ._models_py3 import DataTransferDetailsValidationResponseProperties -from ._models_py3 import DataboxJobSecrets -from ._models_py3 import DatacenterAddressInstructionResponse -from ._models_py3 import DatacenterAddressLocationResponse -from ._models_py3 import DatacenterAddressRequest -from ._models_py3 import DatacenterAddressResponse -from ._models_py3 import DcAccessSecurityCode -from ._models_py3 import Details -from ._models_py3 import DeviceErasureDetails -from ._models_py3 import DiskScheduleAvailabilityRequest -from ._models_py3 import DiskSecret -from ._models_py3 import EncryptionPreferences -from ._models_py3 import ErrorDetail -from ._models_py3 import ExportDiskDetails -from ._models_py3 import FilterFileDetails -from ._models_py3 import GranularCopyLogDetails -from ._models_py3 import GranularCopyProgress -from ._models_py3 import HeavyScheduleAvailabilityRequest -from ._models_py3 import IdentityProperties -from ._models_py3 import ImportDiskDetails -from ._models_py3 import JobDeliveryInfo -from ._models_py3 import JobDetails -from ._models_py3 import JobResource -from ._models_py3 import JobResourceList -from ._models_py3 import JobResourceUpdateParameter -from ._models_py3 import JobSecrets -from ._models_py3 import JobStages -from ._models_py3 import KeyEncryptionKey -from ._models_py3 import LastMitigationActionOnJob -from ._models_py3 import ManagedDiskDetails -from ._models_py3 import MarkDevicesShippedRequest -from ._models_py3 import MitigateJobRequest -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import PackageCarrierDetails -from ._models_py3 import PackageCarrierInfo -from ._models_py3 import PackageShippingDetails -from ._models_py3 import Preferences -from ._models_py3 import PreferencesValidationRequest -from ._models_py3 import PreferencesValidationResponseProperties -from ._models_py3 import RegionConfigurationRequest -from ._models_py3 import RegionConfigurationResponse -from ._models_py3 import Resource -from ._models_py3 import ResourceIdentity -from ._models_py3 import ReverseShippingDetails -from ._models_py3 import ScheduleAvailabilityRequest -from ._models_py3 import ScheduleAvailabilityResponse -from ._models_py3 import ShareCredentialDetails -from ._models_py3 import ShipmentPickUpRequest -from ._models_py3 import ShipmentPickUpResponse -from ._models_py3 import ShippingAddress -from ._models_py3 import Sku -from ._models_py3 import SkuAvailabilityValidationRequest -from ._models_py3 import SkuAvailabilityValidationResponseProperties -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuInformation -from ._models_py3 import StorageAccountDetails -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties -from ._models_py3 import SystemData -from ._models_py3 import TransferAllDetails -from ._models_py3 import TransferConfiguration -from ._models_py3 import TransferConfigurationTransferAllDetails -from ._models_py3 import TransferConfigurationTransferFilterDetails -from ._models_py3 import TransferFilterDetails -from ._models_py3 import TransportAvailabilityDetails -from ._models_py3 import TransportAvailabilityRequest -from ._models_py3 import TransportAvailabilityResponse -from ._models_py3 import TransportPreferences -from ._models_py3 import UnencryptedCredentials -from ._models_py3 import UnencryptedCredentialsList -from ._models_py3 import UpdateJobDetails -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import UserAssignedProperties -from ._models_py3 import ValidateAddress -from ._models_py3 import ValidationInputRequest -from ._models_py3 import ValidationInputResponse -from ._models_py3 import ValidationRequest -from ._models_py3 import ValidationResponse - -from ._data_box_management_client_enums import AccessProtocol -from ._data_box_management_client_enums import AddressType -from ._data_box_management_client_enums import AddressValidationStatus -from ._data_box_management_client_enums import ClassDiscriminator -from ._data_box_management_client_enums import CopyStatus -from ._data_box_management_client_enums import CustomerResolutionCode -from ._data_box_management_client_enums import DataAccountType -from ._data_box_management_client_enums import DataCenterCode -from ._data_box_management_client_enums import DatacenterAddressType -from ._data_box_management_client_enums import DoubleEncryption -from ._data_box_management_client_enums import FilterFileType -from ._data_box_management_client_enums import JobDeliveryType -from ._data_box_management_client_enums import KekType -from ._data_box_management_client_enums import LogCollectionLevel -from ._data_box_management_client_enums import NotificationStageName -from ._data_box_management_client_enums import OverallValidationStatus -from ._data_box_management_client_enums import ReverseShippingDetailsEditStatus -from ._data_box_management_client_enums import ReverseTransportPreferenceEditStatus -from ._data_box_management_client_enums import ShareDestinationFormatType -from ._data_box_management_client_enums import SkuDisabledReason -from ._data_box_management_client_enums import SkuName -from ._data_box_management_client_enums import StageName -from ._data_box_management_client_enums import StageStatus -from ._data_box_management_client_enums import TransferConfigurationType -from ._data_box_management_client_enums import TransferType -from ._data_box_management_client_enums import TransportShipmentTypes -from ._data_box_management_client_enums import ValidationInputDiscriminator -from ._data_box_management_client_enums import ValidationStatus -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccountCredentialDetails", - "AdditionalErrorInfo", - "AddressValidationOutput", - "AddressValidationProperties", - "ApiError", - "ApplianceNetworkConfiguration", - "ArmBaseObject", - "AvailableSkuRequest", - "AvailableSkusResult", - "AzureFileFilterDetails", - "BlobFilterDetails", - "CancellationReason", - "CloudError", - "ContactDetails", - "ContactInfo", - "CopyLogDetails", - "CopyProgress", - "CreateJobValidations", - "CreateOrderLimitForSubscriptionValidationRequest", - "CreateOrderLimitForSubscriptionValidationResponseProperties", - "CustomerDiskJobSecrets", - "DataAccountDetails", - "DataBoxAccountCopyLogDetails", - "DataBoxCustomerDiskCopyLogDetails", - "DataBoxCustomerDiskCopyProgress", - "DataBoxCustomerDiskJobDetails", - "DataBoxDiskCopyLogDetails", - "DataBoxDiskCopyProgress", - "DataBoxDiskGranularCopyLogDetails", - "DataBoxDiskGranularCopyProgress", - "DataBoxDiskJobDetails", - "DataBoxDiskJobSecrets", - "DataBoxHeavyAccountCopyLogDetails", - "DataBoxHeavyJobDetails", - "DataBoxHeavyJobSecrets", - "DataBoxHeavySecret", - "DataBoxJobDetails", - "DataBoxScheduleAvailabilityRequest", - "DataBoxSecret", - "DataExportDetails", - "DataImportDetails", - "DataLocationToServiceLocationMap", - "DataTransferDetailsValidationRequest", - "DataTransferDetailsValidationResponseProperties", - "DataboxJobSecrets", - "DatacenterAddressInstructionResponse", - "DatacenterAddressLocationResponse", - "DatacenterAddressRequest", - "DatacenterAddressResponse", - "DcAccessSecurityCode", - "Details", - "DeviceErasureDetails", - "DiskScheduleAvailabilityRequest", - "DiskSecret", - "EncryptionPreferences", - "ErrorDetail", - "ExportDiskDetails", - "FilterFileDetails", - "GranularCopyLogDetails", - "GranularCopyProgress", - "HeavyScheduleAvailabilityRequest", - "IdentityProperties", - "ImportDiskDetails", - "JobDeliveryInfo", - "JobDetails", - "JobResource", - "JobResourceList", - "JobResourceUpdateParameter", - "JobSecrets", - "JobStages", - "KeyEncryptionKey", - "LastMitigationActionOnJob", - "ManagedDiskDetails", - "MarkDevicesShippedRequest", - "MitigateJobRequest", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationList", - "PackageCarrierDetails", - "PackageCarrierInfo", - "PackageShippingDetails", - "Preferences", - "PreferencesValidationRequest", - "PreferencesValidationResponseProperties", - "RegionConfigurationRequest", - "RegionConfigurationResponse", - "Resource", - "ResourceIdentity", - "ReverseShippingDetails", - "ScheduleAvailabilityRequest", - "ScheduleAvailabilityResponse", - "ShareCredentialDetails", - "ShipmentPickUpRequest", - "ShipmentPickUpResponse", - "ShippingAddress", - "Sku", - "SkuAvailabilityValidationRequest", - "SkuAvailabilityValidationResponseProperties", - "SkuCapacity", - "SkuCost", - "SkuInformation", - "StorageAccountDetails", - "SubscriptionIsAllowedToCreateJobValidationRequest", - "SubscriptionIsAllowedToCreateJobValidationResponseProperties", - "SystemData", - "TransferAllDetails", - "TransferConfiguration", - "TransferConfigurationTransferAllDetails", - "TransferConfigurationTransferFilterDetails", - "TransferFilterDetails", - "TransportAvailabilityDetails", - "TransportAvailabilityRequest", - "TransportAvailabilityResponse", - "TransportPreferences", - "UnencryptedCredentials", - "UnencryptedCredentialsList", - "UpdateJobDetails", - "UserAssignedIdentity", - "UserAssignedProperties", - "ValidateAddress", - "ValidationInputRequest", - "ValidationInputResponse", - "ValidationRequest", - "ValidationResponse", - "AccessProtocol", - "AddressType", - "AddressValidationStatus", - "ClassDiscriminator", - "CopyStatus", - "CustomerResolutionCode", - "DataAccountType", - "DataCenterCode", - "DatacenterAddressType", - "DoubleEncryption", - "FilterFileType", - "JobDeliveryType", - "KekType", - "LogCollectionLevel", - "NotificationStageName", - "OverallValidationStatus", - "ReverseShippingDetailsEditStatus", - "ReverseTransportPreferenceEditStatus", - "ShareDestinationFormatType", - "SkuDisabledReason", - "SkuName", - "StageName", - "StageStatus", - "TransferConfigurationType", - "TransferType", - "TransportShipmentTypes", - "ValidationInputDiscriminator", - "ValidationStatus", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/_data_box_management_client_enums.py deleted file mode 100644 index fb93cbf48581..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/_data_box_management_client_enums.py +++ /dev/null @@ -1,474 +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 enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" - - SMB = "SMB" - """Server Message Block protocol(SMB).""" - NFS = "NFS" - """Network File System protocol(NFS).""" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The address validation status.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the type of job details.""" - - DATA_BOX = "DataBox" - """Data Box orders.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk orders.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy orders.""" - DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk orders.""" - - -class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Status of the copy.""" - - NOT_STARTED = "NotStarted" - """Data copy hasn't started yet.""" - IN_PROGRESS = "InProgress" - """Data copy is in progress.""" - COMPLETED = "Completed" - """Data copy completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Data copy completed with errors.""" - FAILED = "Failed" - """Data copy failed. No data was copied.""" - NOT_RETURNED = "NotReturned" - """No copy triggered as device was not returned.""" - HARDWARE_ERROR = "HardwareError" - """The Device has hit hardware issues.""" - DEVICE_FORMATTED = "DeviceFormatted" - """Data copy failed. The Device was formatted by user.""" - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" - """Data copy failed. Device metadata was modified by user.""" - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" - """Data copy failed. Storage Account was not accessible during copy.""" - UNSUPPORTED_DATA = "UnsupportedData" - """Data copy failed. The Device data content is not supported.""" - DRIVE_NOT_RECEIVED = "DriveNotReceived" - """No copy triggered as device was not received.""" - UNSUPPORTED_DRIVE = "UnsupportedDrive" - """No copy triggered as device type is not supported.""" - OTHER_SERVICE_ERROR = "OtherServiceError" - """Copy failed due to service error.""" - OTHER_USER_ERROR = "OtherUserError" - """Copy failed due to user error.""" - DRIVE_NOT_DETECTED = "DriveNotDetected" - """Copy failed due to disk detection error.""" - DRIVE_CORRUPTED = "DriveCorrupted" - """Copy failed due to corrupted drive.""" - METADATA_FILES_MODIFIED_OR_REMOVED = "MetadataFilesModifiedOrRemoved" - """Copy failed due to modified or removed metadata files.""" - - -class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """CustomerResolutionCode.""" - - NONE = "None" - """No Resolution Yet""" - MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" - """Clean the device""" - RESUME = "Resume" - """Resume the job to same stage""" - RESTART = "Restart" - """Restart whole action.""" - REACH_OUT_TO_OPERATION = "ReachOutToOperation" - """Reach out to operation for further action.""" - - -class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the account.""" - - STORAGE_ACCOUNT = "StorageAccount" - """Storage Accounts .""" - MANAGED_DISK = "ManagedDisk" - """Azure Managed disk storage.""" - - -class DatacenterAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data center address type.""" - - DATACENTER_ADDRESS_LOCATION = "DatacenterAddressLocation" - """Data center address location.""" - DATACENTER_ADDRESS_INSTRUCTION = "DatacenterAddressInstruction" - """Data center address instruction.""" - - -class DataCenterCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DataCenter code.""" - - INVALID = "Invalid" - BY2 = "BY2" - BY1 = "BY1" - ORK70 = "ORK70" - AM2 = "AM2" - AMS20 = "AMS20" - BY21 = "BY21" - BY24 = "BY24" - MWH01 = "MWH01" - AMS06 = "AMS06" - SSE90 = "SSE90" - SYD03 = "SYD03" - SYD23 = "SYD23" - CBR20 = "CBR20" - YTO20 = "YTO20" - CWL20 = "CWL20" - LON24 = "LON24" - BOM01 = "BOM01" - BL20 = "BL20" - BL7 = "BL7" - SEL20 = "SEL20" - TYO01 = "TYO01" - BN1 = "BN1" - SN5 = "SN5" - CYS04 = "CYS04" - TYO22 = "TYO22" - YTO21 = "YTO21" - YQB20 = "YQB20" - FRA22 = "FRA22" - MAA01 = "MAA01" - CPQ02 = "CPQ02" - CPQ20 = "CPQ20" - SIN20 = "SIN20" - HKG20 = "HKG20" - SG2 = "SG2" - MEL23 = "MEL23" - SEL21 = "SEL21" - OSA20 = "OSA20" - SHA03 = "SHA03" - BJB = "BJB" - JNB22 = "JNB22" - JNB21 = "JNB21" - MNZ21 = "MNZ21" - SN8 = "SN8" - AUH20 = "AUH20" - ZRH20 = "ZRH20" - PUS20 = "PUS20" - AD_HOC = "AdHoc" - CH1 = "CH1" - DSM05 = "DSM05" - DUB07 = "DUB07" - PNQ01 = "PNQ01" - SVG20 = "SVG20" - OSA02 = "OSA02" - OSA22 = "OSA22" - PAR22 = "PAR22" - BN7 = "BN7" - SN6 = "SN6" - BJS20 = "BJS20" - - -class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines secondary layer of software-based encryption enablement.""" - - ENABLED = "Enabled" - """Software-based encryption is enabled.""" - DISABLED = "Disabled" - """Software-based encryption is disabled.""" - - -class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the filter file.""" - - AZURE_BLOB = "AzureBlob" - """Filter file is of the type AzureBlob.""" - AZURE_FILE = "AzureFile" - """Filter file is of the type AzureFiles.""" - - -class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Delivery type of Job.""" - - NON_SCHEDULED = "NonScheduled" - """Non Scheduled job.""" - SCHEDULED = "Scheduled" - """Scheduled job.""" - - -class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of encryption key used for key encryption.""" - - MICROSOFT_MANAGED = "MicrosoftManaged" - """Key encryption key is managed by Microsoft.""" - CUSTOMER_MANAGED = "CustomerManaged" - """Key encryption key is managed by the Customer.""" - - -class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of the logs to be collected.""" - - ERROR = "Error" - """Only Errors will be collected in the logs.""" - VERBOSE = "Verbose" - """Verbose logging (includes Errors, CRC, size information and others).""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - DEVICE_PREPARED = "DevicePrepared" - """Notification at device prepared stage.""" - DISPATCHED = "Dispatched" - """Notification at device dispatched stage.""" - DELIVERED = "Delivered" - """Notification at device delivered stage.""" - PICKED_UP = "PickedUp" - """Notification at device picked up from user stage.""" - AT_AZURE_DC = "AtAzureDC" - """Notification at device received at Azure datacenter stage.""" - DATA_COPY = "DataCopy" - """Notification at data copy started stage.""" - CREATED = "Created" - """Notification at job created stage.""" - SHIPPED_TO_CUSTOMER = "ShippedToCustomer" - """Notification at shipped devices to customer stage.""" - - -class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall validation status.""" - - ALL_VALID_TO_PROCEED = "AllValidToProceed" - """Every input request is valid.""" - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" - """Some input requests are not valid.""" - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" - """Certain input validations skipped.""" - - -class ReverseShippingDetailsEditStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Editable status for Reverse Shipping Address and Contact Info.""" - - ENABLED = "Enabled" - """Reverse shipping details can be edited.""" - DISABLED = "Disabled" - """Edit is disabled for Reverse shipping details.""" - NOT_SUPPORTED = "NotSupported" - """Edit is not supported for Reverse shipping details. Either subscription feature is not - #: available or SKU doesn't support this feature.""" - - -class ReverseTransportPreferenceEditStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Editable status for Reverse Transport preferences.""" - - ENABLED = "Enabled" - """Reverse Transport Preferences can be edited.""" - DISABLED = "Disabled" - """Edit is disabled for Reverse Transport Preferences.""" - NOT_SUPPORTED = "NotSupported" - """Edit is not supported for Reverse Transport Preferences. Either subscription feature is not - #: available or SKU doesn't support this feature.""" - - -class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the share.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown format.""" - HCS = "HCS" - """Storsimple data format.""" - BLOCK_BLOB = "BlockBlob" - """Azure storage block blob format.""" - PAGE_BLOB = "PageBlob" - """Azure storage page blob format.""" - AZURE_FILE = "AzureFile" - """Azure storage file format.""" - MANAGED_DISK = "ManagedDisk" - """Azure Compute Disk.""" - - -class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the Sku is disabled.""" - - NONE = "None" - """SKU is not disabled.""" - COUNTRY = "Country" - """SKU is not available in the requested country.""" - REGION = "Region" - """SKU is not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled for the SKU.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types for the SKU.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" - - DATA_BOX = "DataBox" - """Data Box.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy.""" - DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk""" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage which is in progress.""" - - DEVICE_ORDERED = "DeviceOrdered" - """An order has been created.""" - DEVICE_PREPARED = "DevicePrepared" - """A device has been prepared for the order.""" - DISPATCHED = "Dispatched" - """Device has been dispatched to the user of the order.""" - DELIVERED = "Delivered" - """Device has been delivered to the user of the order.""" - PICKED_UP = "PickedUp" - """Device has been picked up from user and in transit to Azure datacenter.""" - AT_AZURE_DC = "AtAzureDC" - """Device has been received at Azure datacenter from the user.""" - DATA_COPY = "DataCopy" - """Data copy from the device at Azure datacenter.""" - COMPLETED = "Completed" - """Order has completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Order has completed with errors.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" - """Order has failed due to issue reported by user.""" - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" - """Order has failed due to issue detected at Azure datacenter.""" - ABORTED = "Aborted" - """Order has been aborted.""" - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - """Order has completed with warnings.""" - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" - """Device is ready to be handed to customer from Azure DC.""" - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" - """Device can be dropped off at Azure DC.""" - CREATED = "Created" - """Job created by the customer.""" - SHIPPED_TO_AZURE_DC = "ShippedToAzureDC" - """User shipped the device to AzureDC.""" - AWAITING_SHIPMENT_DETAILS = "AwaitingShipmentDetails" - """Awaiting shipment details of device from customer.""" - PREPARING_TO_SHIP_FROM_AZURE_DC = "PreparingToShipFromAzureDC" - """Preparing the device to ship to customer.""" - SHIPPED_TO_CUSTOMER = "ShippedToCustomer" - """Shipped the device to customer.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Holds the device erasure completion status.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" - """Stage has succeeded with errors.""" - WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" - """Stage is stuck until customer takes some action.""" - SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" - """Stage has succeeded with warnings.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" - """Stage is waiting for customer action for kek action items.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" - """Stage is waiting for customer action for clean up.""" - CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" - """Stage has performed customer action for clean up.""" - CUSTOMER_ACTION_PERFORMED = "CustomerActionPerformed" - """Stage has performed customer action for clean up.""" - - -class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the configuration for transfer.""" - - TRANSFER_ALL = "TransferAll" - """Transfer all the data.""" - TRANSFER_USING_FILTER = "TransferUsingFilter" - """Transfer using filter.""" - - -class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the transfer.""" - - IMPORT_TO_AZURE = "ImportToAzure" - """Import data to azure.""" - EXPORT_FROM_AZURE = "ExportFromAzure" - """Export data from azure.""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Transport Shipment Type supported for given region.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Identifies the type of validation request.""" - - VALIDATE_ADDRESS = "ValidateAddress" - """Identify request and response of address validation.""" - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" - """Identify request and response for validation of subscription permission to create job.""" - VALIDATE_PREFERENCES = "ValidatePreferences" - """Identify request and response of preference validation.""" - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" - """Identify request and response of create order limit for subscription validation.""" - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" - """Identify request and response of active job limit for sku availability.""" - VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" - """Identify request and response of data transfer details validation.""" - - -class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Create order limit validation status.""" - - VALID = "Valid" - """Validation is successful""" - INVALID = "Invalid" - """Validation is not successful""" - SKIPPED = "Skipped" - """Validation is skipped""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/_models_py3.py deleted file mode 100644 index 5aa40e6f2c16..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/_models_py3.py +++ /dev/null @@ -1,6314 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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, 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 # pylint: disable=ungrouped-imports -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_09_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2022_09_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_09_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2022_09_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2022_09_01.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 Azure. - - :ivar error: Required. - :vartype error: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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 Azure. - - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.AdditionalErrorInfo] - :ivar code: Error code. - :vartype code: str - :ivar details: Gets or sets details for the error. - :vartype details: list[~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.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.v2022_09_01.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 Azure. - - :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 Azure. - - :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.v2022_09_01.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): # pylint: disable=too-many-instance-attributes - """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.v2022_09_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_09_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -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 Azure. - - :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.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_09_01.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.v2022_09_01.models.SkuName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - } - - def __init__(self, *, device_type: Union[str, "_models.SkuName"], **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.v2022_09_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.device_type = device_type - - -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_09_01.models.CloudError - :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_09_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_09_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_09_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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): # pylint: disable=too-many-instance-attributes - """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.v2022_09_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_09_01.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 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.v2022_09_01.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}, - "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"}, - "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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_09_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_09_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_09_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_09_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_09_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_09_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_09_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_09_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_09_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_09_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_09_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_09_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_09_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_09_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_09_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_09_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.ExportDiskDetails] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: - list[~azure.mgmt.databox.v2022_09_01.models.DataBoxCustomerDiskCopyProgress] - :ivar deliver_to_dc_package_details: Delivery package shipping details. - :vartype deliver_to_dc_package_details: - ~azure.mgmt.databox.v2022_09_01.models.PackageCarrierInfo - :ivar return_to_customer_package_details: Return package shipping details. Required. - :vartype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_09_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_09_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ImportDiskDetails] - :keyword return_to_customer_package_details: Return package shipping details. Required. - :paramtype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.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.v2022_09_01.models.CopyStatus - """ - - _validation = { - "serial_number": {"readonly": True}, - "bytes_copied": {"readonly": True}, - "percent_complete": {"readonly": True}, - "status": {"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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = 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 Azure. - - :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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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): # pylint: disable=too-many-instance-attributes - """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.v2022_09_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_09_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -class DataBoxDiskGranularCopyProgress(GranularCopyProgress): # pylint: disable=too-many-instance-attributes - """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.v2022_09_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_09_01.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 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.v2022_09_01.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}, - "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"}, - "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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_09_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_09_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_09_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_09_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_09_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_09_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_09_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.DataBoxDiskCopyProgress] - :ivar granular_copy_progress: Copy progress per disk. - :vartype granular_copy_progress: - list[~azure.mgmt.databox.v2022_09_01.models.DataBoxDiskGranularCopyProgress] - :ivar granular_copy_log_details: Copy progress per disk. - :vartype granular_copy_log_details: - list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_09_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_09_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_09_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_09_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_09_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_09_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_09_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_09_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_09_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_09_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_09_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_09_01.models.DataCenterCode - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_09_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_09_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_09_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_09_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_09_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_09_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_09_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_09_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_09_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_09_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_09_01.models.DataCenterCode - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_09_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_09_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_09_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_09_01.models.CloudError - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - _subtype_map = { - "sku_name": { - "DataBox": "DataBoxScheduleAvailabilityRequest", - "DataBoxDisk": "DiskScheduleAvailabilityRequest", - "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", - } - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name: Optional[str] = None - self.country = country - - -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 Azure. - - :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.v2022_09_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2022_09_01.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.v2022_09_01.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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2022_09_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.SkuName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, storage_location: str, sku_name: Union[str, "_models.SkuName"], **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.v2022_09_01.models.SkuName - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name = sku_name - - -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 Azure. - - :ivar transfer_configuration: Configuration for the data transfer. Required. - :vartype transfer_configuration: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.LogCollectionLevel - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.LogCollectionLevel - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.DataImportDetails] - :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype device_type: str or ~azure.mgmt.databox.v2022_09_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2022_09_01.models.TransferType - """ - - _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"}, - } - - 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, - **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.v2022_09_01.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.v2022_09_01.models.DataImportDetails] - :keyword device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype device_type: str or ~azure.mgmt.databox.v2022_09_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2022_09_01.models.TransferType - """ - 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 - - -class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): - """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 Azure. - - :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.v2022_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_09_01.models.CloudError - :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", - and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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 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.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :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"}, - "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, - **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 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, **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.v2022_09_01.models.DoubleEncryption - """ - - _attribute_map = { - "double_encryption": {"key": "doubleEncryption", "type": "str"}, - } - - def __init__( - self, *, double_encryption: Union[str, "_models.DoubleEncryption"] = "Disabled", **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.v2022_09_01.models.DoubleEncryption - """ - super().__init__(**kwargs) - self.double_encryption = double_encryption - - -class ErrorDetail(_serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to Azure. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar details: - :vartype details: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2022_09_01.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.v2022_09_01.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 Azure. - - :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 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 Azure. - - :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.v2022_09_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2022_09_01.models.ResourceIdentity - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - self.identity = identity - - -class JobResource(Resource): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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.v2022_09_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.CloudError - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.JobDeliveryType - :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.v2022_09_01.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: 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}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "is_cancellable_without_fee": {"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"}, - "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"}, - } - - def __init__( - 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.v2022_09_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.TransferType - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.v2022_09_01.models.JobDetails - :keyword delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :paramtype delivery_type: str or ~azure.mgmt.databox.v2022_09_01.models.JobDeliveryType - :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.v2022_09_01.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.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 - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.ResourceIdentity - :ivar details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ResourceIdentity - :keyword details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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 - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"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"}, - } - - 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 - - -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 Azure. - - :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.v2022_09_01.models.KekType - :ivar identity_properties: Managed identity properties used for key encryption. - :vartype identity_properties: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.KekType - :keyword identity_properties: Managed identity properties used for key encryption. - :paramtype identity_properties: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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 Azure. - - :ivar deliver_to_dc_package_details: Delivery package details. Required. - :vartype deliver_to_dc_package_details: - ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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. - - All required parameters must be populated in order to send to Azure. - - :ivar customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". - :vartype customer_resolution_code: str or - ~azure.mgmt.databox.v2022_09_01.models.CustomerResolutionCode - """ - - _validation = { - "customer_resolution_code": {"required": True}, - } - - _attribute_map = { - "customer_resolution_code": {"key": "customerResolutionCode", "type": "str"}, - } - - def __init__( - self, *, customer_resolution_code: Union[str, "_models.CustomerResolutionCode"], **kwargs: Any - ) -> None: - """ - :keyword customer_resolution_code: Resolution code for the job. Required. Known values are: - "None", "MoveToCleanUpDevice", "Resume", "Restart", and "ReachOutToOperation". - :paramtype customer_resolution_code: str or - ~azure.mgmt.databox.v2022_09_01.models.CustomerResolutionCode - """ - super().__init__(**kwargs) - self.customer_resolution_code = customer_resolution_code - - -class NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.TransportPreferences - :ivar reverse_transport_preferences: Optional Preferences related to the reverse shipment - logistics of the sku. - :vartype reverse_transport_preferences: - ~azure.mgmt.databox.v2022_09_01.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.TransportPreferences - :keyword reverse_transport_preferences: Optional Preferences related to the reverse shipment - logistics of the sku. - :paramtype reverse_transport_preferences: - ~azure.mgmt.databox.v2022_09_01.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.ValidationInputDiscriminator - :ivar preference: Preference of transport and data center. - :vartype preference: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.SkuName - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - preference: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: Preference of transport and data center. - :paramtype preference: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.preference = preference - self.device_type = device_type - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.ScheduleAvailabilityRequest - :ivar transport_availability_request: Request body to get the transport availability for given - sku. - :vartype transport_availability_request: - ~azure.mgmt.databox.v2022_09_01.models.TransportAvailabilityRequest - :ivar datacenter_address_request: Request body to get the datacenter address for given sku. - :vartype datacenter_address_request: - ~azure.mgmt.databox.v2022_09_01.models.DatacenterAddressRequest - """ - - _attribute_map = { - "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, - "transport_availability_request": { - "key": "transportAvailabilityRequest", - "type": "TransportAvailabilityRequest", - }, - "datacenter_address_request": {"key": "datacenterAddressRequest", "type": "DatacenterAddressRequest"}, - } - - def __init__( - self, - *, - schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, - datacenter_address_request: Optional["_models.DatacenterAddressRequest"] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_availability_request: Request body to get the availability for scheduling - orders. - :paramtype schedule_availability_request: - ~azure.mgmt.databox.v2022_09_01.models.ScheduleAvailabilityRequest - :keyword transport_availability_request: Request body to get the transport availability for - given sku. - :paramtype transport_availability_request: - ~azure.mgmt.databox.v2022_09_01.models.TransportAvailabilityRequest - :keyword datacenter_address_request: Request body to get the datacenter address for given sku. - :paramtype datacenter_address_request: - ~azure.mgmt.databox.v2022_09_01.models.DatacenterAddressRequest - """ - super().__init__(**kwargs) - self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_request - self.datacenter_address_request = datacenter_address_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.v2022_09_01.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.v2022_09_01.models.TransportAvailabilityResponse - :ivar datacenter_address_response: Datacenter address for given sku in a region. - :vartype datacenter_address_response: - ~azure.mgmt.databox.v2022_09_01.models.DatacenterAddressResponse - """ - - _validation = { - "schedule_availability_response": {"readonly": True}, - "transport_availability_response": {"readonly": True}, - "datacenter_address_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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_response = None - self.datacenter_address_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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.ContactInfo - :ivar shipping_address: Shipping address where customer wishes to receive the device. - :vartype shipping_address: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ContactInfo - :keyword shipping_address: Shipping address where customer wishes to receive the device. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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 Azure. - - :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 Azure. - - :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.v2022_09_01.models.AddressType - """ - - _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"}, - } - - 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", - **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.v2022_09_01.models.AddressType - """ - 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 - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", - and "DataBoxCustomerDisk". - :vartype name: str or ~azure.mgmt.databox.v2022_09_01.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = 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.v2022_09_01.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_09_01.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.v2022_09_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2022_09_01.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 - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - transfer_type: Union[str, "_models.TransferType"], - country: str, - location: str, - **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.v2022_09_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2022_09_01.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 - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.device_type = device_type - self.transfer_type = transfer_type - self.country = country - self.location = location - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_09_01.models.CloudError - :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2022_09_01.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 - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = 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.v2022_09_01.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.v2022_09_01.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2022_09_01.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_09_01.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): - """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 Azure. - - :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.v2022_09_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.TransferAllDetails - """ - super().__init__(**kwargs) - self.include = include - - -class TransferConfigurationTransferFilterDetails(_serialization.Model): - """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.v2022_09_01.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.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.DataAccountType - :ivar blob_filter_details: Filter details to transfer blobs. - :vartype blob_filter_details: ~azure.mgmt.databox.v2022_09_01.models.BlobFilterDetails - :ivar azure_file_filter_details: Filter details to transfer Azure files. - :vartype azure_file_filter_details: - ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.DataAccountType - :keyword blob_filter_details: Filter details to transfer blobs. - :paramtype blob_filter_details: ~azure.mgmt.databox.v2022_09_01.models.BlobFilterDetails - :keyword azure_file_filter_details: Filter details to transfer Azure files. - :paramtype azure_file_filter_details: - ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.SkuName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = 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.v2022_09_01.models.SkuName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - - -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.v2022_09_01.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 Azure. - - :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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.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.v2022_09_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :ivar reverse_shipping_details: Reverse Shipping Address and contact details for a job. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :ivar preferences: Preferences related to the order. - :vartype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :ivar key_encryption_key: Key encryption key for the job. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.models.KeyEncryptionKey - :ivar return_to_customer_package_details: Return package details of job. - :vartype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_09_01.models.ShippingAddress - :keyword reverse_shipping_details: Reverse Shipping Address and contact details for a job. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_09_01.models.ReverseShippingDetails - :keyword preferences: Preferences related to the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_09_01.models.Preferences - :keyword key_encryption_key: Key encryption key for the job. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_09_01.models.KeyEncryptionKey - :keyword return_to_customer_package_details: Return package details of job. - :paramtype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_09_01.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 Azure. - - :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.v2022_09_01.models.ValidationInputDiscriminator - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.SkuName - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: ~azure.mgmt.databox.v2022_09_01.models.TransportPreferences - """ - - _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"}, - } - - def __init__( - self, - *, - shipping_address: "_models.ShippingAddress", - device_type: Union[str, "_models.SkuName"], - transport_preferences: Optional["_models.TransportPreferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_09_01.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.v2022_09_01.models.SkuName - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: ~azure.mgmt.databox.v2022_09_01.models.TransportPreferences - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.shipping_address = shipping_address - self.device_type = device_type - self.transport_preferences = transport_preferences - - -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.v2022_09_01.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.v2022_09_01.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/v2022_09_01/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_data_box_management_client_operations.py deleted file mode 100644 index 0c2e090e360e..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,210 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2022-09-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 = _format_url_section(_url, **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( # pylint: disable=inconsistent-return-statements - 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.v2022_09_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2022_09_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_jobs_operations.py deleted file mode 100644 index 2a1797e21393..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_jobs_operations.py +++ /dev/null @@ -1,1739 +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 typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, 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.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .._vendor import DataBoxManagementClientMixinABC, _convert_request, _format_url_section - -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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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.v2022_09_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @overload - def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - 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.v2022_09_01.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @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], - **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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2022_09_01.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.mark_devices_shipped.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_09_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_09_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_09_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2022_09_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2022-09-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_09_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_09_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_09_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2022_09_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_09_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2022_09_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - 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.v2022_09_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2022_09_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_operations.py deleted file mode 100644 index 1620898f063d..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_operations.py +++ /dev/null @@ -1,155 +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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar -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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request - -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(**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", "2022-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2022_09_01.DataBoxManagementClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_09_01.models.Operation] - :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", "2022-09-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_service_operations.py deleted file mode 100644 index 164144b481a0..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/operations/_service_operations.py +++ /dev/null @@ -1,1083 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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", "2022-09-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 = _format_url_section(_url, **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.v2022_09_01.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.v2022_09_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_09_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2022_09_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_09_01.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", "2022-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2022_09_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2022_09_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2022_09_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_09_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_09_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_09_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_09_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2022_09_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_09_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-09-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_09_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_configuration.py deleted file mode 100644 index 8682f9852a96..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-10-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-10-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_data_box_management_client.py deleted file mode 100644 index abb0bfd77611..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2022_10_01.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2022_10_01.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2022_10_01.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-10-01". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_metadata.json deleted file mode 100644 index b67476eb5fa4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "chosen_version": "2022-10-01", - "total_api_version_list": ["2022-10-01"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - }, - "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "sync_mixin_typing_definitions": "", - "async_mixin_typing_definitions": "", - "operations": { - "mitigate" : { - "sync": { - "signature": "def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2022_10_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2022_10_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - } - } - } - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_vendor.py deleted file mode 100644 index ec8d8f6dd7b4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_vendor.py +++ /dev/null @@ -1,48 +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 List, TYPE_CHECKING, cast - -from azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from .._serialization import Deserializer, Serializer - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - -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/v2022_10_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_configuration.py deleted file mode 100644 index ca6c6ed468d5..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-10-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-10-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_data_box_management_client.py deleted file mode 100644 index 157f92f3a74b..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2022_10_01.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2022_10_01.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2022_10_01.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-10-01". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_vendor.py deleted file mode 100644 index 54f3d3ec6541..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/_vendor.py +++ /dev/null @@ -1,28 +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 azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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/v2022_10_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_data_box_management_client_operations.py deleted file mode 100644 index 1db8b41616e1..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,176 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -from ...operations._data_box_management_client_operations import build_mitigate_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC): - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - 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.v2022_10_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2022_10_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_jobs_operations.py deleted file mode 100644 index 154830720520..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,1432 +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 typing import Any, AsyncIterable, 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, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2022_10_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @overload - async def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - 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.v2022_10_01.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async 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], - **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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2022_10_01.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.mark_devices_shipped.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_10_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_10_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_10_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2022_10_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2022-10-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_10_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_10_01.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, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_10_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2022_10_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_10_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2022_10_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - 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.v2022_10_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2022_10_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_operations.py deleted file mode 100644 index 3d00fb6aebb0..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_operations.py +++ /dev/null @@ -1,135 +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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -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 ..._vendor import _convert_request -from ...operations._operations import build_list_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2022_10_01.aio.DataBoxManagementClient`'s - :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") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_10_01.models.Operation] - :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", "2022-10-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_service_operations.py deleted file mode 100644 index ac82c2c62441..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/aio/operations/_service_operations.py +++ /dev/null @@ -1,897 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2022_10_01.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.v2022_10_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_10_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_10_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2022_10_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2022_10_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2022_10_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2022_10_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_10_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_10_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_10_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_10_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2022_10_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/__init__.py deleted file mode 100644 index 6cdca764f767..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/__init__.py +++ /dev/null @@ -1,323 +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 ._models_py3 import AccountCredentialDetails -from ._models_py3 import AdditionalErrorInfo -from ._models_py3 import AddressValidationOutput -from ._models_py3 import AddressValidationProperties -from ._models_py3 import ApiError -from ._models_py3 import ApplianceNetworkConfiguration -from ._models_py3 import ArmBaseObject -from ._models_py3 import AvailableSkuRequest -from ._models_py3 import AvailableSkusResult -from ._models_py3 import AzureFileFilterDetails -from ._models_py3 import BlobFilterDetails -from ._models_py3 import CancellationReason -from ._models_py3 import CloudError -from ._models_py3 import ContactDetails -from ._models_py3 import ContactInfo -from ._models_py3 import CopyLogDetails -from ._models_py3 import CopyProgress -from ._models_py3 import CreateJobValidations -from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest -from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties -from ._models_py3 import CustomerDiskJobSecrets -from ._models_py3 import DataAccountDetails -from ._models_py3 import DataBoxAccountCopyLogDetails -from ._models_py3 import DataBoxCustomerDiskCopyLogDetails -from ._models_py3 import DataBoxCustomerDiskCopyProgress -from ._models_py3 import DataBoxCustomerDiskJobDetails -from ._models_py3 import DataBoxDiskCopyLogDetails -from ._models_py3 import DataBoxDiskCopyProgress -from ._models_py3 import DataBoxDiskGranularCopyLogDetails -from ._models_py3 import DataBoxDiskGranularCopyProgress -from ._models_py3 import DataBoxDiskJobDetails -from ._models_py3 import DataBoxDiskJobSecrets -from ._models_py3 import DataBoxHeavyAccountCopyLogDetails -from ._models_py3 import DataBoxHeavyJobDetails -from ._models_py3 import DataBoxHeavyJobSecrets -from ._models_py3 import DataBoxHeavySecret -from ._models_py3 import DataBoxJobDetails -from ._models_py3 import DataBoxScheduleAvailabilityRequest -from ._models_py3 import DataBoxSecret -from ._models_py3 import DataExportDetails -from ._models_py3 import DataImportDetails -from ._models_py3 import DataLocationToServiceLocationMap -from ._models_py3 import DataTransferDetailsValidationRequest -from ._models_py3 import DataTransferDetailsValidationResponseProperties -from ._models_py3 import DataboxJobSecrets -from ._models_py3 import DatacenterAddressInstructionResponse -from ._models_py3 import DatacenterAddressLocationResponse -from ._models_py3 import DatacenterAddressRequest -from ._models_py3 import DatacenterAddressResponse -from ._models_py3 import DcAccessSecurityCode -from ._models_py3 import Details -from ._models_py3 import DeviceErasureDetails -from ._models_py3 import DiskScheduleAvailabilityRequest -from ._models_py3 import DiskSecret -from ._models_py3 import EncryptionPreferences -from ._models_py3 import ErrorDetail -from ._models_py3 import ExportDiskDetails -from ._models_py3 import FilterFileDetails -from ._models_py3 import GranularCopyLogDetails -from ._models_py3 import GranularCopyProgress -from ._models_py3 import HeavyScheduleAvailabilityRequest -from ._models_py3 import IdentityProperties -from ._models_py3 import ImportDiskDetails -from ._models_py3 import JobDeliveryInfo -from ._models_py3 import JobDetails -from ._models_py3 import JobResource -from ._models_py3 import JobResourceList -from ._models_py3 import JobResourceUpdateParameter -from ._models_py3 import JobSecrets -from ._models_py3 import JobStages -from ._models_py3 import KeyEncryptionKey -from ._models_py3 import LastMitigationActionOnJob -from ._models_py3 import ManagedDiskDetails -from ._models_py3 import MarkDevicesShippedRequest -from ._models_py3 import MitigateJobRequest -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import PackageCarrierDetails -from ._models_py3 import PackageCarrierInfo -from ._models_py3 import PackageShippingDetails -from ._models_py3 import Preferences -from ._models_py3 import PreferencesValidationRequest -from ._models_py3 import PreferencesValidationResponseProperties -from ._models_py3 import RegionConfigurationRequest -from ._models_py3 import RegionConfigurationResponse -from ._models_py3 import Resource -from ._models_py3 import ResourceIdentity -from ._models_py3 import ReverseShippingDetails -from ._models_py3 import ScheduleAvailabilityRequest -from ._models_py3 import ScheduleAvailabilityResponse -from ._models_py3 import ShareCredentialDetails -from ._models_py3 import ShipmentPickUpRequest -from ._models_py3 import ShipmentPickUpResponse -from ._models_py3 import ShippingAddress -from ._models_py3 import Sku -from ._models_py3 import SkuAvailabilityValidationRequest -from ._models_py3 import SkuAvailabilityValidationResponseProperties -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuInformation -from ._models_py3 import StorageAccountDetails -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest -from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties -from ._models_py3 import SystemData -from ._models_py3 import TransferAllDetails -from ._models_py3 import TransferConfiguration -from ._models_py3 import TransferConfigurationTransferAllDetails -from ._models_py3 import TransferConfigurationTransferFilterDetails -from ._models_py3 import TransferFilterDetails -from ._models_py3 import TransportAvailabilityDetails -from ._models_py3 import TransportAvailabilityRequest -from ._models_py3 import TransportAvailabilityResponse -from ._models_py3 import TransportPreferences -from ._models_py3 import UnencryptedCredentials -from ._models_py3 import UnencryptedCredentialsList -from ._models_py3 import UpdateJobDetails -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import UserAssignedProperties -from ._models_py3 import ValidateAddress -from ._models_py3 import ValidationInputRequest -from ._models_py3 import ValidationInputResponse -from ._models_py3 import ValidationRequest -from ._models_py3 import ValidationResponse - -from ._data_box_management_client_enums import AccessProtocol -from ._data_box_management_client_enums import AddressType -from ._data_box_management_client_enums import AddressValidationStatus -from ._data_box_management_client_enums import ClassDiscriminator -from ._data_box_management_client_enums import CopyStatus -from ._data_box_management_client_enums import CustomerResolutionCode -from ._data_box_management_client_enums import DataAccountType -from ._data_box_management_client_enums import DataCenterCode -from ._data_box_management_client_enums import DatacenterAddressType -from ._data_box_management_client_enums import DoubleEncryption -from ._data_box_management_client_enums import FilterFileType -from ._data_box_management_client_enums import JobDeliveryType -from ._data_box_management_client_enums import KekType -from ._data_box_management_client_enums import LogCollectionLevel -from ._data_box_management_client_enums import NotificationStageName -from ._data_box_management_client_enums import OverallValidationStatus -from ._data_box_management_client_enums import ReverseShippingDetailsEditStatus -from ._data_box_management_client_enums import ReverseTransportPreferenceEditStatus -from ._data_box_management_client_enums import ShareDestinationFormatType -from ._data_box_management_client_enums import SkuDisabledReason -from ._data_box_management_client_enums import SkuName -from ._data_box_management_client_enums import StageName -from ._data_box_management_client_enums import StageStatus -from ._data_box_management_client_enums import TransferConfigurationType -from ._data_box_management_client_enums import TransferType -from ._data_box_management_client_enums import TransportShipmentTypes -from ._data_box_management_client_enums import ValidationInputDiscriminator -from ._data_box_management_client_enums import ValidationStatus -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccountCredentialDetails", - "AdditionalErrorInfo", - "AddressValidationOutput", - "AddressValidationProperties", - "ApiError", - "ApplianceNetworkConfiguration", - "ArmBaseObject", - "AvailableSkuRequest", - "AvailableSkusResult", - "AzureFileFilterDetails", - "BlobFilterDetails", - "CancellationReason", - "CloudError", - "ContactDetails", - "ContactInfo", - "CopyLogDetails", - "CopyProgress", - "CreateJobValidations", - "CreateOrderLimitForSubscriptionValidationRequest", - "CreateOrderLimitForSubscriptionValidationResponseProperties", - "CustomerDiskJobSecrets", - "DataAccountDetails", - "DataBoxAccountCopyLogDetails", - "DataBoxCustomerDiskCopyLogDetails", - "DataBoxCustomerDiskCopyProgress", - "DataBoxCustomerDiskJobDetails", - "DataBoxDiskCopyLogDetails", - "DataBoxDiskCopyProgress", - "DataBoxDiskGranularCopyLogDetails", - "DataBoxDiskGranularCopyProgress", - "DataBoxDiskJobDetails", - "DataBoxDiskJobSecrets", - "DataBoxHeavyAccountCopyLogDetails", - "DataBoxHeavyJobDetails", - "DataBoxHeavyJobSecrets", - "DataBoxHeavySecret", - "DataBoxJobDetails", - "DataBoxScheduleAvailabilityRequest", - "DataBoxSecret", - "DataExportDetails", - "DataImportDetails", - "DataLocationToServiceLocationMap", - "DataTransferDetailsValidationRequest", - "DataTransferDetailsValidationResponseProperties", - "DataboxJobSecrets", - "DatacenterAddressInstructionResponse", - "DatacenterAddressLocationResponse", - "DatacenterAddressRequest", - "DatacenterAddressResponse", - "DcAccessSecurityCode", - "Details", - "DeviceErasureDetails", - "DiskScheduleAvailabilityRequest", - "DiskSecret", - "EncryptionPreferences", - "ErrorDetail", - "ExportDiskDetails", - "FilterFileDetails", - "GranularCopyLogDetails", - "GranularCopyProgress", - "HeavyScheduleAvailabilityRequest", - "IdentityProperties", - "ImportDiskDetails", - "JobDeliveryInfo", - "JobDetails", - "JobResource", - "JobResourceList", - "JobResourceUpdateParameter", - "JobSecrets", - "JobStages", - "KeyEncryptionKey", - "LastMitigationActionOnJob", - "ManagedDiskDetails", - "MarkDevicesShippedRequest", - "MitigateJobRequest", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationList", - "PackageCarrierDetails", - "PackageCarrierInfo", - "PackageShippingDetails", - "Preferences", - "PreferencesValidationRequest", - "PreferencesValidationResponseProperties", - "RegionConfigurationRequest", - "RegionConfigurationResponse", - "Resource", - "ResourceIdentity", - "ReverseShippingDetails", - "ScheduleAvailabilityRequest", - "ScheduleAvailabilityResponse", - "ShareCredentialDetails", - "ShipmentPickUpRequest", - "ShipmentPickUpResponse", - "ShippingAddress", - "Sku", - "SkuAvailabilityValidationRequest", - "SkuAvailabilityValidationResponseProperties", - "SkuCapacity", - "SkuCost", - "SkuInformation", - "StorageAccountDetails", - "SubscriptionIsAllowedToCreateJobValidationRequest", - "SubscriptionIsAllowedToCreateJobValidationResponseProperties", - "SystemData", - "TransferAllDetails", - "TransferConfiguration", - "TransferConfigurationTransferAllDetails", - "TransferConfigurationTransferFilterDetails", - "TransferFilterDetails", - "TransportAvailabilityDetails", - "TransportAvailabilityRequest", - "TransportAvailabilityResponse", - "TransportPreferences", - "UnencryptedCredentials", - "UnencryptedCredentialsList", - "UpdateJobDetails", - "UserAssignedIdentity", - "UserAssignedProperties", - "ValidateAddress", - "ValidationInputRequest", - "ValidationInputResponse", - "ValidationRequest", - "ValidationResponse", - "AccessProtocol", - "AddressType", - "AddressValidationStatus", - "ClassDiscriminator", - "CopyStatus", - "CustomerResolutionCode", - "DataAccountType", - "DataCenterCode", - "DatacenterAddressType", - "DoubleEncryption", - "FilterFileType", - "JobDeliveryType", - "KekType", - "LogCollectionLevel", - "NotificationStageName", - "OverallValidationStatus", - "ReverseShippingDetailsEditStatus", - "ReverseTransportPreferenceEditStatus", - "ShareDestinationFormatType", - "SkuDisabledReason", - "SkuName", - "StageName", - "StageStatus", - "TransferConfigurationType", - "TransferType", - "TransportShipmentTypes", - "ValidationInputDiscriminator", - "ValidationStatus", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/_data_box_management_client_enums.py deleted file mode 100644 index fb93cbf48581..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/_data_box_management_client_enums.py +++ /dev/null @@ -1,474 +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 enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessProtocol.""" - - SMB = "SMB" - """Server Message Block protocol(SMB).""" - NFS = "NFS" - """Network File System protocol(NFS).""" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The address validation status.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the type of job details.""" - - DATA_BOX = "DataBox" - """Data Box orders.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk orders.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy orders.""" - DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk orders.""" - - -class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Status of the copy.""" - - NOT_STARTED = "NotStarted" - """Data copy hasn't started yet.""" - IN_PROGRESS = "InProgress" - """Data copy is in progress.""" - COMPLETED = "Completed" - """Data copy completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Data copy completed with errors.""" - FAILED = "Failed" - """Data copy failed. No data was copied.""" - NOT_RETURNED = "NotReturned" - """No copy triggered as device was not returned.""" - HARDWARE_ERROR = "HardwareError" - """The Device has hit hardware issues.""" - DEVICE_FORMATTED = "DeviceFormatted" - """Data copy failed. The Device was formatted by user.""" - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" - """Data copy failed. Device metadata was modified by user.""" - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" - """Data copy failed. Storage Account was not accessible during copy.""" - UNSUPPORTED_DATA = "UnsupportedData" - """Data copy failed. The Device data content is not supported.""" - DRIVE_NOT_RECEIVED = "DriveNotReceived" - """No copy triggered as device was not received.""" - UNSUPPORTED_DRIVE = "UnsupportedDrive" - """No copy triggered as device type is not supported.""" - OTHER_SERVICE_ERROR = "OtherServiceError" - """Copy failed due to service error.""" - OTHER_USER_ERROR = "OtherUserError" - """Copy failed due to user error.""" - DRIVE_NOT_DETECTED = "DriveNotDetected" - """Copy failed due to disk detection error.""" - DRIVE_CORRUPTED = "DriveCorrupted" - """Copy failed due to corrupted drive.""" - METADATA_FILES_MODIFIED_OR_REMOVED = "MetadataFilesModifiedOrRemoved" - """Copy failed due to modified or removed metadata files.""" - - -class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """CustomerResolutionCode.""" - - NONE = "None" - """No Resolution Yet""" - MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" - """Clean the device""" - RESUME = "Resume" - """Resume the job to same stage""" - RESTART = "Restart" - """Restart whole action.""" - REACH_OUT_TO_OPERATION = "ReachOutToOperation" - """Reach out to operation for further action.""" - - -class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the account.""" - - STORAGE_ACCOUNT = "StorageAccount" - """Storage Accounts .""" - MANAGED_DISK = "ManagedDisk" - """Azure Managed disk storage.""" - - -class DatacenterAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data center address type.""" - - DATACENTER_ADDRESS_LOCATION = "DatacenterAddressLocation" - """Data center address location.""" - DATACENTER_ADDRESS_INSTRUCTION = "DatacenterAddressInstruction" - """Data center address instruction.""" - - -class DataCenterCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DataCenter code.""" - - INVALID = "Invalid" - BY2 = "BY2" - BY1 = "BY1" - ORK70 = "ORK70" - AM2 = "AM2" - AMS20 = "AMS20" - BY21 = "BY21" - BY24 = "BY24" - MWH01 = "MWH01" - AMS06 = "AMS06" - SSE90 = "SSE90" - SYD03 = "SYD03" - SYD23 = "SYD23" - CBR20 = "CBR20" - YTO20 = "YTO20" - CWL20 = "CWL20" - LON24 = "LON24" - BOM01 = "BOM01" - BL20 = "BL20" - BL7 = "BL7" - SEL20 = "SEL20" - TYO01 = "TYO01" - BN1 = "BN1" - SN5 = "SN5" - CYS04 = "CYS04" - TYO22 = "TYO22" - YTO21 = "YTO21" - YQB20 = "YQB20" - FRA22 = "FRA22" - MAA01 = "MAA01" - CPQ02 = "CPQ02" - CPQ20 = "CPQ20" - SIN20 = "SIN20" - HKG20 = "HKG20" - SG2 = "SG2" - MEL23 = "MEL23" - SEL21 = "SEL21" - OSA20 = "OSA20" - SHA03 = "SHA03" - BJB = "BJB" - JNB22 = "JNB22" - JNB21 = "JNB21" - MNZ21 = "MNZ21" - SN8 = "SN8" - AUH20 = "AUH20" - ZRH20 = "ZRH20" - PUS20 = "PUS20" - AD_HOC = "AdHoc" - CH1 = "CH1" - DSM05 = "DSM05" - DUB07 = "DUB07" - PNQ01 = "PNQ01" - SVG20 = "SVG20" - OSA02 = "OSA02" - OSA22 = "OSA22" - PAR22 = "PAR22" - BN7 = "BN7" - SN6 = "SN6" - BJS20 = "BJS20" - - -class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines secondary layer of software-based encryption enablement.""" - - ENABLED = "Enabled" - """Software-based encryption is enabled.""" - DISABLED = "Disabled" - """Software-based encryption is disabled.""" - - -class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the filter file.""" - - AZURE_BLOB = "AzureBlob" - """Filter file is of the type AzureBlob.""" - AZURE_FILE = "AzureFile" - """Filter file is of the type AzureFiles.""" - - -class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Delivery type of Job.""" - - NON_SCHEDULED = "NonScheduled" - """Non Scheduled job.""" - SCHEDULED = "Scheduled" - """Scheduled job.""" - - -class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of encryption key used for key encryption.""" - - MICROSOFT_MANAGED = "MicrosoftManaged" - """Key encryption key is managed by Microsoft.""" - CUSTOMER_MANAGED = "CustomerManaged" - """Key encryption key is managed by the Customer.""" - - -class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of the logs to be collected.""" - - ERROR = "Error" - """Only Errors will be collected in the logs.""" - VERBOSE = "Verbose" - """Verbose logging (includes Errors, CRC, size information and others).""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - DEVICE_PREPARED = "DevicePrepared" - """Notification at device prepared stage.""" - DISPATCHED = "Dispatched" - """Notification at device dispatched stage.""" - DELIVERED = "Delivered" - """Notification at device delivered stage.""" - PICKED_UP = "PickedUp" - """Notification at device picked up from user stage.""" - AT_AZURE_DC = "AtAzureDC" - """Notification at device received at Azure datacenter stage.""" - DATA_COPY = "DataCopy" - """Notification at data copy started stage.""" - CREATED = "Created" - """Notification at job created stage.""" - SHIPPED_TO_CUSTOMER = "ShippedToCustomer" - """Notification at shipped devices to customer stage.""" - - -class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall validation status.""" - - ALL_VALID_TO_PROCEED = "AllValidToProceed" - """Every input request is valid.""" - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" - """Some input requests are not valid.""" - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" - """Certain input validations skipped.""" - - -class ReverseShippingDetailsEditStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Editable status for Reverse Shipping Address and Contact Info.""" - - ENABLED = "Enabled" - """Reverse shipping details can be edited.""" - DISABLED = "Disabled" - """Edit is disabled for Reverse shipping details.""" - NOT_SUPPORTED = "NotSupported" - """Edit is not supported for Reverse shipping details. Either subscription feature is not - #: available or SKU doesn't support this feature.""" - - -class ReverseTransportPreferenceEditStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Editable status for Reverse Transport preferences.""" - - ENABLED = "Enabled" - """Reverse Transport Preferences can be edited.""" - DISABLED = "Disabled" - """Edit is disabled for Reverse Transport Preferences.""" - NOT_SUPPORTED = "NotSupported" - """Edit is not supported for Reverse Transport Preferences. Either subscription feature is not - #: available or SKU doesn't support this feature.""" - - -class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the share.""" - - UNKNOWN_TYPE = "UnknownType" - """Unknown format.""" - HCS = "HCS" - """Storsimple data format.""" - BLOCK_BLOB = "BlockBlob" - """Azure storage block blob format.""" - PAGE_BLOB = "PageBlob" - """Azure storage page blob format.""" - AZURE_FILE = "AzureFile" - """Azure storage file format.""" - MANAGED_DISK = "ManagedDisk" - """Azure Compute Disk.""" - - -class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the Sku is disabled.""" - - NONE = "None" - """SKU is not disabled.""" - COUNTRY = "Country" - """SKU is not available in the requested country.""" - REGION = "Region" - """SKU is not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled for the SKU.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types for the SKU.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SkuName.""" - - DATA_BOX = "DataBox" - """Data Box.""" - DATA_BOX_DISK = "DataBoxDisk" - """Data Box Disk.""" - DATA_BOX_HEAVY = "DataBoxHeavy" - """Data Box Heavy.""" - DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" - """Data Box Customer Disk""" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage which is in progress.""" - - DEVICE_ORDERED = "DeviceOrdered" - """An order has been created.""" - DEVICE_PREPARED = "DevicePrepared" - """A device has been prepared for the order.""" - DISPATCHED = "Dispatched" - """Device has been dispatched to the user of the order.""" - DELIVERED = "Delivered" - """Device has been delivered to the user of the order.""" - PICKED_UP = "PickedUp" - """Device has been picked up from user and in transit to Azure datacenter.""" - AT_AZURE_DC = "AtAzureDC" - """Device has been received at Azure datacenter from the user.""" - DATA_COPY = "DataCopy" - """Data copy from the device at Azure datacenter.""" - COMPLETED = "Completed" - """Order has completed.""" - COMPLETED_WITH_ERRORS = "CompletedWithErrors" - """Order has completed with errors.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" - """Order has failed due to issue reported by user.""" - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" - """Order has failed due to issue detected at Azure datacenter.""" - ABORTED = "Aborted" - """Order has been aborted.""" - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - """Order has completed with warnings.""" - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" - """Device is ready to be handed to customer from Azure DC.""" - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" - """Device can be dropped off at Azure DC.""" - CREATED = "Created" - """Job created by the customer.""" - SHIPPED_TO_AZURE_DC = "ShippedToAzureDC" - """User shipped the device to AzureDC.""" - AWAITING_SHIPMENT_DETAILS = "AwaitingShipmentDetails" - """Awaiting shipment details of device from customer.""" - PREPARING_TO_SHIP_FROM_AZURE_DC = "PreparingToShipFromAzureDC" - """Preparing the device to ship to customer.""" - SHIPPED_TO_CUSTOMER = "ShippedToCustomer" - """Shipped the device to customer.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Holds the device erasure completion status.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" - """Stage has succeeded with errors.""" - WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" - """Stage is stuck until customer takes some action.""" - SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" - """Stage has succeeded with warnings.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" - """Stage is waiting for customer action for kek action items.""" - WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" - """Stage is waiting for customer action for clean up.""" - CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" - """Stage has performed customer action for clean up.""" - CUSTOMER_ACTION_PERFORMED = "CustomerActionPerformed" - """Stage has performed customer action for clean up.""" - - -class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the configuration for transfer.""" - - TRANSFER_ALL = "TransferAll" - """Transfer all the data.""" - TRANSFER_USING_FILTER = "TransferUsingFilter" - """Transfer using filter.""" - - -class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the transfer.""" - - IMPORT_TO_AZURE = "ImportToAzure" - """Import data to azure.""" - EXPORT_FROM_AZURE = "ExportFromAzure" - """Export data from azure.""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Transport Shipment Type supported for given region.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Identifies the type of validation request.""" - - VALIDATE_ADDRESS = "ValidateAddress" - """Identify request and response of address validation.""" - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" - """Identify request and response for validation of subscription permission to create job.""" - VALIDATE_PREFERENCES = "ValidatePreferences" - """Identify request and response of preference validation.""" - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" - """Identify request and response of create order limit for subscription validation.""" - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" - """Identify request and response of active job limit for sku availability.""" - VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" - """Identify request and response of data transfer details validation.""" - - -class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Create order limit validation status.""" - - VALID = "Valid" - """Validation is successful""" - INVALID = "Invalid" - """Validation is not successful""" - SKIPPED = "Skipped" - """Validation is skipped""" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/_models_py3.py deleted file mode 100644 index e709ab9687f8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/_models_py3.py +++ /dev/null @@ -1,6350 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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, 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 # pylint: disable=ungrouped-imports -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_10_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2022_10_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_10_01.models.CloudError - :ivar validation_status: The address validation status. Known values are: "Valid", "Invalid", - and "Ambiguous". - :vartype validation_status: str or - ~azure.mgmt.databox.v2022_10_01.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.v2022_10_01.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 Azure. - - :ivar error: Required. - :vartype error: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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 Azure. - - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.AdditionalErrorInfo] - :ivar code: Error code. - :vartype code: str - :ivar details: Gets or sets details for the error. - :vartype details: list[~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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 Azure. - - :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.v2022_10_01.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): # pylint: disable=too-many-instance-attributes - """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.v2022_10_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_10_01.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 - """ - - _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}, - } - - _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"}, - } - - 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 - - -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 Azure. - - :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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_10_01.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.v2022_10_01.models.SkuName - """ - - _validation = { - "validation_type": {"required": True}, - "device_type": {"required": True}, - } - - _attribute_map = { - "validation_type": {"key": "validationType", "type": "str"}, - "device_type": {"key": "deviceType", "type": "str"}, - } - - def __init__(self, *, device_type: Union[str, "_models.SkuName"], **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.v2022_10_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateCreateOrderLimit" - self.device_type = device_type - - -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_10_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_10_01.models.CloudError - :ivar status: Create order limit validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_10_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_10_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_10_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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): # pylint: disable=too-many-instance-attributes - """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.v2022_10_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_10_01.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 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.v2022_10_01.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}, - "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"}, - "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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_10_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_10_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_10_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_10_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_10_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_10_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_10_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_10_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_10_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_10_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_10_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_10_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_10_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_10_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_10_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_10_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.ExportDiskDetails] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: - list[~azure.mgmt.databox.v2022_10_01.models.DataBoxCustomerDiskCopyProgress] - :ivar deliver_to_dc_package_details: Delivery package shipping details. - :vartype deliver_to_dc_package_details: - ~azure.mgmt.databox.v2022_10_01.models.PackageCarrierInfo - :ivar return_to_customer_package_details: Return package shipping details. Required. - :vartype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_10_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_10_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ImportDiskDetails] - :keyword return_to_customer_package_details: Return package shipping details. Required. - :paramtype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.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.v2022_10_01.models.CopyStatus - :ivar error: Error, if any, in the stage. - :vartype error: ~azure.mgmt.databox.v2022_10_01.models.CloudError - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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): # pylint: disable=too-many-instance-attributes - """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.v2022_10_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.CloudError - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.v2022_10_01.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): # pylint: disable=too-many-instance-attributes - """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.v2022_10_01.models.TransferType - :ivar data_account_type: Data Account Type. Known values are: "StorageAccount" and - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.CloudError - :ivar actions: Available actions on the job. - :vartype actions: list[str or ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_10_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_10_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_10_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_10_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_10_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_10_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_10_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.DataBoxDiskCopyProgress] - :ivar granular_copy_progress: Copy progress per disk. - :vartype granular_copy_progress: - list[~azure.mgmt.databox.v2022_10_01.models.DataBoxDiskGranularCopyProgress] - :ivar granular_copy_log_details: Copy progress per disk. - :vartype granular_copy_log_details: - list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_10_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_10_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_10_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_10_01.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_10_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_10_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_10_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_10_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_10_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_10_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_10_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_10_01.models.DataCenterCode - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_10_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_10_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_10_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.v2022_10_01.models.JobStages] - :ivar contact_details: Contact details for notification and shipping. Required. - :vartype contact_details: ~azure.mgmt.databox.v2022_10_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.v2022_10_01.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.v2022_10_01.models.PackageShippingDetails - :ivar data_import_details: Details of the data to be imported into azure. - :vartype data_import_details: list[~azure.mgmt.databox.v2022_10_01.models.DataImportDetails] - :ivar data_export_details: Details of the data to be exported from azure. - :vartype data_export_details: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ClassDiscriminator - :ivar preferences: Preferences for the order. - :vartype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :ivar reverse_shipping_details: Optional Reverse Shipping details for order. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.DeviceErasureDetails - :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.CustomerResolutionCode] - :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. - :vartype last_mitigation_action_on_job: - ~azure.mgmt.databox.v2022_10_01.models.LastMitigationActionOnJob - :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage - location. - :vartype datacenter_address: ~azure.mgmt.databox.v2022_10_01.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", - and "BJS20". - :vartype data_center_code: str or ~azure.mgmt.databox.v2022_10_01.models.DataCenterCode - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :keyword data_import_details: Details of the data to be imported into azure. - :paramtype data_import_details: list[~azure.mgmt.databox.v2022_10_01.models.DataImportDetails] - :keyword data_export_details: Details of the data to be exported from azure. - :paramtype data_export_details: list[~azure.mgmt.databox.v2022_10_01.models.DataExportDetails] - :keyword preferences: Preferences for the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :keyword reverse_shipping_details: Optional Reverse Shipping details for order. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :keyword key_encryption_key: Details about which key encryption type is being used. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.v2022_10_01.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.v2022_10_01.models.CloudError - :ivar pod_secrets: Contains the list of secret objects for a job. - :vartype pod_secrets: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - _subtype_map = { - "sku_name": { - "DataBox": "DataBoxScheduleAvailabilityRequest", - "DataBoxDisk": "DiskScheduleAvailabilityRequest", - "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", - } - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name: Optional[str] = None - self.country = country - - -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 Azure. - - :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.v2022_10_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2022_10_01.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.v2022_10_01.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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2022_10_01.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): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :ivar datacenter_address_type: Data center address type. Required. Known values are: - "DatacenterAddressLocation" and "DatacenterAddressInstruction". - :vartype datacenter_address_type: str or - ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.SkuName - """ - - _validation = { - "storage_location": {"required": True}, - "sku_name": {"required": True}, - } - - _attribute_map = { - "storage_location": {"key": "storageLocation", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, storage_location: str, sku_name: Union[str, "_models.SkuName"], **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.v2022_10_01.models.SkuName - """ - super().__init__(**kwargs) - self.storage_location = storage_location - self.sku_name = sku_name - - -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 Azure. - - :ivar transfer_configuration: Configuration for the data transfer. Required. - :vartype transfer_configuration: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.LogCollectionLevel - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.LogCollectionLevel - :keyword account_details: Account details of the data to be transferred. Required. - :paramtype account_details: ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :ivar account_details: Account details of the data to be transferred. Required. - :vartype account_details: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.DataImportDetails] - :ivar device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :vartype device_type: str or ~azure.mgmt.databox.v2022_10_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2022_10_01.models.TransferType - """ - - _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"}, - } - - 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, - **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.v2022_10_01.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.v2022_10_01.models.DataImportDetails] - :keyword device_type: Device type. Required. Known values are: "DataBox", "DataBoxDisk", - "DataBoxHeavy", and "DataBoxCustomerDisk". - :paramtype device_type: str or ~azure.mgmt.databox.v2022_10_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2022_10_01.models.TransferType - """ - 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 - - -class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): - """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 Azure. - - :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.v2022_10_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_10_01.models.CloudError - :ivar status: Data transfer details validation status. Known values are: "Valid", "Invalid", - and "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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 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.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - :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"}, - "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, - **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 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, **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.v2022_10_01.models.DoubleEncryption - """ - - _attribute_map = { - "double_encryption": {"key": "doubleEncryption", "type": "str"}, - } - - def __init__( - self, *, double_encryption: Union[str, "_models.DoubleEncryption"] = "Disabled", **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.v2022_10_01.models.DoubleEncryption - """ - super().__init__(**kwargs) - self.double_encryption = double_encryption - - -class ErrorDetail(_serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to Azure. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar details: - :vartype details: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.SkuName - :ivar country: Country in which storage location should be supported. - :vartype country: str - """ - - _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"}, - } - - def __init__(self, *, storage_location: str, country: Optional[str] = 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 - """ - super().__init__(storage_location=storage_location, country=country, **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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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 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 Azure. - - :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.v2022_10_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2022_10_01.models.ResourceIdentity - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - self.identity = identity - - -class JobResource(Resource): # pylint: disable=too-many-instance-attributes - """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 Azure. - - :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.v2022_10_01.models.Sku - :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.CloudError - :ivar details: Details of a job run. This field will only be sent for expand details filter. - :vartype details: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.JobDeliveryType - :ivar delivery_info: Delivery Info of Job. - :vartype delivery_info: ~azure.mgmt.databox.v2022_10_01.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: 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}, - "start_time": {"readonly": True}, - "error": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "is_cancellable_without_fee": {"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"}, - "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"}, - } - - def __init__( - 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.v2022_10_01.models.Sku - :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.TransferType - :keyword details: Details of a job run. This field will only be sent for expand details filter. - :paramtype details: ~azure.mgmt.databox.v2022_10_01.models.JobDetails - :keyword delivery_type: Delivery type of Job. Known values are: "NonScheduled" and "Scheduled". - :paramtype delivery_type: str or ~azure.mgmt.databox.v2022_10_01.models.JobDeliveryType - :keyword delivery_info: Delivery Info of Job. - :paramtype delivery_info: ~azure.mgmt.databox.v2022_10_01.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.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 - - -class JobResourceList(_serialization.Model): - """Job Resource Collection. - - :ivar value: List of job resources. - :vartype value: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.ResourceIdentity - :ivar details: Details of a job to be updated. - :vartype details: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ResourceIdentity - :keyword details: Details of a job to be updated. - :paramtype details: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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 - """ - - _validation = { - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "stage_status": {"readonly": True}, - "stage_time": {"readonly": True}, - "job_stage_details": {"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"}, - } - - 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 - - -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 Azure. - - :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.v2022_10_01.models.KekType - :ivar identity_properties: Managed identity properties used for key encryption. - :vartype identity_properties: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.KekType - :keyword identity_properties: Managed identity properties used for key encryption. - :paramtype identity_properties: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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 Azure. - - :ivar deliver_to_dc_package_details: Delivery package details. Required. - :vartype deliver_to_dc_package_details: - ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.TransportPreferences - :ivar reverse_transport_preferences: Optional Preferences related to the reverse shipment - logistics of the sku. - :vartype reverse_transport_preferences: - ~azure.mgmt.databox.v2022_10_01.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.TransportPreferences - :keyword reverse_transport_preferences: Optional Preferences related to the reverse shipment - logistics of the sku. - :paramtype reverse_transport_preferences: - ~azure.mgmt.databox.v2022_10_01.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.ValidationInputDiscriminator - :ivar preference: Preference of transport and data center. - :vartype preference: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.SkuName - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - preference: Optional["_models.Preferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: Preference of transport and data center. - :paramtype preference: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.SkuName - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidatePreferences" - self.preference = preference - self.device_type = device_type - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_10_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.ScheduleAvailabilityRequest - :ivar transport_availability_request: Request body to get the transport availability for given - sku. - :vartype transport_availability_request: - ~azure.mgmt.databox.v2022_10_01.models.TransportAvailabilityRequest - :ivar datacenter_address_request: Request body to get the datacenter address for given sku. - :vartype datacenter_address_request: - ~azure.mgmt.databox.v2022_10_01.models.DatacenterAddressRequest - """ - - _attribute_map = { - "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, - "transport_availability_request": { - "key": "transportAvailabilityRequest", - "type": "TransportAvailabilityRequest", - }, - "datacenter_address_request": {"key": "datacenterAddressRequest", "type": "DatacenterAddressRequest"}, - } - - def __init__( - self, - *, - schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, - datacenter_address_request: Optional["_models.DatacenterAddressRequest"] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_availability_request: Request body to get the availability for scheduling - orders. - :paramtype schedule_availability_request: - ~azure.mgmt.databox.v2022_10_01.models.ScheduleAvailabilityRequest - :keyword transport_availability_request: Request body to get the transport availability for - given sku. - :paramtype transport_availability_request: - ~azure.mgmt.databox.v2022_10_01.models.TransportAvailabilityRequest - :keyword datacenter_address_request: Request body to get the datacenter address for given sku. - :paramtype datacenter_address_request: - ~azure.mgmt.databox.v2022_10_01.models.DatacenterAddressRequest - """ - super().__init__(**kwargs) - self.schedule_availability_request = schedule_availability_request - self.transport_availability_request = transport_availability_request - self.datacenter_address_request = datacenter_address_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.v2022_10_01.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.v2022_10_01.models.TransportAvailabilityResponse - :ivar datacenter_address_response: Datacenter address for given sku in a region. - :vartype datacenter_address_response: - ~azure.mgmt.databox.v2022_10_01.models.DatacenterAddressResponse - """ - - _validation = { - "schedule_availability_response": {"readonly": True}, - "transport_availability_response": {"readonly": True}, - "datacenter_address_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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_response = None - self.datacenter_address_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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.ContactInfo - :ivar shipping_address: Shipping address where customer wishes to receive the device. - :vartype shipping_address: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ContactInfo - :keyword shipping_address: Shipping address where customer wishes to receive the device. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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 Azure. - - :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.v2022_10_01.models.AddressType - """ - - _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"}, - } - - 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", - **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.v2022_10_01.models.AddressType - """ - 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 - - -class Sku(_serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", "DataBoxHeavy", - and "DataBoxCustomerDisk". - :vartype name: str or ~azure.mgmt.databox.v2022_10_01.models.SkuName - :ivar display_name: The display name of the sku. - :vartype display_name: str - :ivar family: The sku family. - :vartype family: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - display_name: Optional[str] = None, - family: Optional[str] = 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.v2022_10_01.models.SkuName - :keyword display_name: The display name of the sku. - :paramtype display_name: str - :keyword family: The sku family. - :paramtype family: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.family = family - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_10_01.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.v2022_10_01.models.SkuName - :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.v2022_10_01.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 - """ - - _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"}, - } - - def __init__( - self, - *, - device_type: Union[str, "_models.SkuName"], - transfer_type: Union[str, "_models.TransferType"], - country: str, - location: str, - **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.v2022_10_01.models.SkuName - :keyword transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and - "ExportFromAzure". - :paramtype transfer_type: str or ~azure.mgmt.databox.v2022_10_01.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 - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateSkuAvailability" - self.device_type = device_type - self.transfer_type = transfer_type - self.country = country - self.location = location - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_10_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_10_01.models.CloudError - :ivar status: Sku availability validation status. Known values are: "Valid", "Invalid", and - "Skipped". - :vartype status: str or ~azure.mgmt.databox.v2022_10_01.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 - """ - - _validation = { - "usable": {"readonly": True}, - "maximum": {"readonly": True}, - } - - _attribute_map = { - "usable": {"key": "usable", "type": "str"}, - "maximum": {"key": "maximum", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.usable = None - self.maximum = 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.v2022_10_01.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.v2022_10_01.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.v2022_10_01.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :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.v2022_10_01.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): - """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 Azure. - - :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.v2022_10_01.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.TransferAllDetails - """ - super().__init__(**kwargs) - self.include = include - - -class TransferConfigurationTransferFilterDetails(_serialization.Model): - """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.v2022_10_01.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.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.DataAccountType - :ivar blob_filter_details: Filter details to transfer blobs. - :vartype blob_filter_details: ~azure.mgmt.databox.v2022_10_01.models.BlobFilterDetails - :ivar azure_file_filter_details: Filter details to transfer Azure files. - :vartype azure_file_filter_details: - ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.DataAccountType - :keyword blob_filter_details: Filter details to transfer blobs. - :paramtype blob_filter_details: ~azure.mgmt.databox.v2022_10_01.models.BlobFilterDetails - :keyword azure_file_filter_details: Filter details to transfer Azure files. - :paramtype azure_file_filter_details: - ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.SkuName - """ - - _attribute_map = { - "sku_name": {"key": "skuName", "type": "str"}, - } - - def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = 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.v2022_10_01.models.SkuName - """ - super().__init__(**kwargs) - self.sku_name = sku_name - - -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.v2022_10_01.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 Azure. - - :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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.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.v2022_10_01.models.ContactDetails - :ivar shipping_address: Shipping address of the customer. - :vartype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :ivar reverse_shipping_details: Reverse Shipping Address and contact details for a job. - :vartype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :ivar preferences: Preferences related to the order. - :vartype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :ivar key_encryption_key: Key encryption key for the job. - :vartype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.models.KeyEncryptionKey - :ivar return_to_customer_package_details: Return package details of job. - :vartype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.ContactDetails - :keyword shipping_address: Shipping address of the customer. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_10_01.models.ShippingAddress - :keyword reverse_shipping_details: Reverse Shipping Address and contact details for a job. - :paramtype reverse_shipping_details: - ~azure.mgmt.databox.v2022_10_01.models.ReverseShippingDetails - :keyword preferences: Preferences related to the order. - :paramtype preferences: ~azure.mgmt.databox.v2022_10_01.models.Preferences - :keyword key_encryption_key: Key encryption key for the job. - :paramtype key_encryption_key: ~azure.mgmt.databox.v2022_10_01.models.KeyEncryptionKey - :keyword return_to_customer_package_details: Return package details of job. - :paramtype return_to_customer_package_details: - ~azure.mgmt.databox.v2022_10_01.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 Azure. - - :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.v2022_10_01.models.ValidationInputDiscriminator - :ivar shipping_address: Shipping address of the customer. Required. - :vartype shipping_address: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.SkuName - :ivar transport_preferences: Preferences related to the shipment logistics of the sku. - :vartype transport_preferences: ~azure.mgmt.databox.v2022_10_01.models.TransportPreferences - """ - - _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"}, - } - - def __init__( - self, - *, - shipping_address: "_models.ShippingAddress", - device_type: Union[str, "_models.SkuName"], - transport_preferences: Optional["_models.TransportPreferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping address of the customer. Required. - :paramtype shipping_address: ~azure.mgmt.databox.v2022_10_01.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.v2022_10_01.models.SkuName - :keyword transport_preferences: Preferences related to the shipment logistics of the sku. - :paramtype transport_preferences: ~azure.mgmt.databox.v2022_10_01.models.TransportPreferences - """ - super().__init__(**kwargs) - self.validation_type: str = "ValidateAddress" - self.shipping_address = shipping_address - self.device_type = device_type - self.transport_preferences = transport_preferences - - -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.v2022_10_01.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.v2022_10_01.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/v2022_10_01/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_data_box_management_client_operations.py deleted file mode 100644 index 2341c336899a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,210 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2022-10-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 = _format_url_section(_url, **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( # pylint: disable=inconsistent-return-statements - 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.v2022_10_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2022_10_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_jobs_operations.py deleted file mode 100644 index 097793c05056..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_jobs_operations.py +++ /dev/null @@ -1,1739 +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 typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, 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.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .._vendor import DataBoxManagementClientMixinABC, _convert_request, _format_url_section - -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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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.v2022_10_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} - - @overload - def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - 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.v2022_10_01.models.MarkDevicesShippedRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mark_devices_shipped( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mark_devices_shipped_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @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], - **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 type. Required. - :type mark_devices_shipped_request: - ~azure.mgmt.databox.v2022_10_01.models.MarkDevicesShippedRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.mark_devices_shipped.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mark_devices_shipped.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobResource or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.JobResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _create_initial( - self, resource_group_name: str, job_name: str, job_resource: Union[_models.JobResource, IO], **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource, (IO, 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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_10_01.models.JobResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_10_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - job_name: str, - job_resource: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_10_01.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], **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 type. - Required. - :type job_resource: ~azure.mgmt.databox.v2022_10_01.models.JobResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> None: - error_map = { - 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", "2022-10-01")) - cls: ClsType[None] = 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, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202, 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.JobResource]: - error_map = { - 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", "2022-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_resource_update_parameter, (IO, 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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, 202]: - 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 = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("JobResource", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_10_01.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_10_01.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - job_name: str, - job_resource_update_parameter: IO, - 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_10_01.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], - 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 type. Required. - :type job_resource_update_parameter: - ~azure.mgmt.databox.v2022_10_01.models.JobResourceUpdateParameter or IO - :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. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}" - } - - @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.v2022_10_01.models.ShipmentPickUpRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.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], - **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 type. Required. - :type shipment_pick_up_request: ~azure.mgmt.databox.v2022_10_01.models.ShipmentPickUpRequest or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShipmentPickUpResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.ShipmentPickUpResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.book_shipment_pick_up.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - book_shipment_pick_up.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - 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.v2022_10_01.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - job_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **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 type. Required. - :type cancellation_reason: ~azure.mgmt.databox.v2022_10_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentials or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None) - - error_map = { - 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, - template_url=self.list_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_operations.py deleted file mode 100644 index acde6931fb82..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_operations.py +++ /dev/null @@ -1,155 +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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar -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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request - -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(**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", "2022-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2022_10_01.DataBoxManagementClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_10_01.models.Operation] - :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", "2022-10-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_service_operations.py deleted file mode 100644 index c189abb657b1..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/operations/_service_operations.py +++ /dev/null @@ -1,1083 +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 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request, _format_url_section - -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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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", "2022-10-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 = _format_url_section(_url, **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.v2022_10_01.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.v2022_10_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_10_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_10_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2022_10_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_10_01.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", "2022-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2022_10_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2022_10_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2022_10_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs_by_resource_group( - self, - resource_group_name: str, - location: str, - validation_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_10_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_10_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_10_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_10_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2022_10_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_10_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-10-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_10_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/__init__.py deleted file mode 100644 index 063260fb2814..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/__init__.py +++ /dev/null @@ -1,26 +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 ._data_box_management_client import DataBoxManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_configuration.py deleted file mode 100644 index 55cb77852d1e..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-12-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-12-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_data_box_management_client.py deleted file mode 100644 index 91fe025a43d1..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2022_12_01.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2022_12_01.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2022_12_01.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-12-01". 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. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - 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, **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) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "DataBoxManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_metadata.json deleted file mode 100644 index 5589f7f180c3..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "chosen_version": "2022-12-01", - "total_api_version_list": ["2022-12-01"], - "client": { - "name": "DataBoxManagementClient", - "filename": "_data_box_management_client", - "description": "The DataBox Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The Subscription Id. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "jobs": "JobsOperations", - "service": "ServiceOperations" - }, - "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "sync_mixin_typing_definitions": "", - "async_mixin_typing_definitions": "", - "operations": { - "mitigate" : { - "sync": { - "signature": "def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2022_12_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def mitigate( # pylint: disable=inconsistent-return-statements\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: Union[_models.MitigateJobRequest, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n Required.\n:type job_name: str\n:param resource_group_name: The Resource Group Name. Required.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO\n type. Required.\n:type mitigate_job_request: ~azure.mgmt.databox.v2022_12_01.models.MitigateJobRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "job_name, resource_group_name, mitigate_job_request, **kwargs" - } - } - } - } -} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_vendor.py deleted file mode 100644 index ec8d8f6dd7b4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_vendor.py +++ /dev/null @@ -1,48 +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 List, TYPE_CHECKING, cast - -from azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from .._serialization import Deserializer, Serializer - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - -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/v2022_12_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/__init__.py deleted file mode 100644 index 955dbd6c6677..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/__init__.py +++ /dev/null @@ -1,23 +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 ._data_box_management_client import DataBoxManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_configuration.py deleted file mode 100644 index d4d7374e4ad2..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_configuration.py +++ /dev/null @@ -1,66 +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 typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-12-01". 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: - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-12-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - 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)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_data_box_management_client.py deleted file mode 100644 index 34416e5ebff4..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_data_box_management_client.py +++ /dev/null @@ -1,99 +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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxManagementClientConfiguration -from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxManagementClient( - DataBoxManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The DataBox Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.v2022_12_01.aio.operations.Operations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.v2022_12_01.aio.operations.JobsOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.v2022_12_01.aio.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Subscription Id. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-12-01". 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. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DataBoxManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._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, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "DataBoxManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_vendor.py deleted file mode 100644 index 54f3d3ec6541..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/_vendor.py +++ /dev/null @@ -1,28 +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 azure.core.pipeline.transport import HttpRequest - -from ._configuration import DataBoxManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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/v2022_12_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_data_box_management_client_operations.py deleted file mode 100644 index 143079f74210..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_data_box_management_client_operations.py +++ /dev/null @@ -1,176 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -from ...operations._data_box_management_client_operations import build_mitigate_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC): - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - 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.v2022_12_01.models.MitigateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: IO, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def mitigate( # pylint: disable=inconsistent-return-statements - self, - job_name: str, - resource_group_name: str, - mitigate_job_request: Union[_models.MitigateJobRequest, IO], - **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 - type. Required. - :type mitigate_job_request: ~azure.mgmt.databox.v2022_12_01.models.MitigateJobRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-12-01")) - 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, (IO, 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, - template_url=self.mitigate.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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, {}) - - mitigate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_operations.py deleted file mode 100644 index d5b3d10d4b36..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_operations.py +++ /dev/null @@ -1,135 +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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -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 ..._vendor import _convert_request -from ...operations._operations import build_list_request -from .._vendor import DataBoxManagementClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2022_12_01.aio.DataBoxManagementClient`'s - :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") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_12_01.models.Operation] - :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", "2022-12-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_service_operations.py deleted file mode 100644 index aa4b6a937c05..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/aio/operations/_service_operations.py +++ /dev/null @@ -1,897 +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 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.pipeline.transport import AsyncHttpResponse -from azure.core.rest import 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 ..._vendor import _convert_request -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, -) -from .._vendor import DataBoxManagementClientMixinABC - -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.v2022_12_01.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.v2022_12_01.models.AvailableSkuRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_12_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_12_01.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], - **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 type. Required. - :type available_sku_request: ~azure.mgmt.databox.v2022_12_01.models.AvailableSkuRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuInformation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2022_12_01.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", "2022-12-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None) - - error_map = { - 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, (IO, 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, - template_url=self.list_available_skus_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - 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) - - list_available_skus_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus" - } - - @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.v2022_12_01.models.ValidateAddress - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_address( - self, location: str, validate_address: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_address( - self, location: str, validate_address: Union[_models.ValidateAddress, IO], **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 type. Required. - :type validate_address: ~azure.mgmt.databox.v2022_12_01.models.ValidateAddress or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressValidationOutput or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.AddressValidationOutput - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-12-01")) - 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, (IO, 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, - template_url=self.validate_address.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_address.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress" - } - - @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.v2022_12_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.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], - **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_12_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-12-01")) - 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, (IO, 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, - template_url=self.validate_inputs_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_12_01.models.ValidationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate_inputs( - self, location: str, validation_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def validate_inputs( - self, location: str, validation_request: Union[_models.ValidationRequest, IO], **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 - type. Required. - :type validation_request: ~azure.mgmt.databox.v2022_12_01.models.ValidationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ValidationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-12-01")) - 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, (IO, 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, - template_url=self.validate_inputs.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - validate_inputs.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs" - } - - @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.v2022_12_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def region_configuration( - self, location: str, region_configuration_request: IO, *, 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def region_configuration( - self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-12-01")) - 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, (IO, 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, - template_url=self.region_configuration.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } - - @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.v2022_12_01.models.RegionConfigurationRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.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, - *, - 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 - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.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], - **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 type. Required. - :type region_configuration_request: - ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RegionConfigurationResponse or the result of cls(response) - :rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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", "2022-12-01")) - 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, (IO, 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, - template_url=self.region_configuration_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - region_configuration_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration" - } diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/__init__.py deleted file mode 100644 index d44a1996902a..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/__init__.py +++ /dev/null @@ -1,25 +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 ._operations import Operations -from ._jobs_operations import JobsOperations -from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin -from ._service_operations import ServiceOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "JobsOperations", - "DataBoxManagementClientOperationsMixin", - "ServiceOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_operations.py deleted file mode 100644 index 5800edfae7bb..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_operations.py +++ /dev/null @@ -1,155 +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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar -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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -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, _convert_request - -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(**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", "2022-12-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databox.v2022_12_01.DataBoxManagementClient`'s - :attr:`operations` 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, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_12_01.models.Operation] - :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", "2022-12-01")) - cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - - error_map = { - 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( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - 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 = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # 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) - - list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""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 - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_12_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file 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 c4588de66fd2..603a063ad7e7 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 3697bce7c2f2..94f3263df5e8 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 39455180d133..2481f3b845f6 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/job_mitigate.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/job_mitigate.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ @@ -29,14 +30,13 @@ def main(): subscription_id="YourSubscriptionId", ) - response = client.mitigate( + client.mitigate( job_name="TestJobName1", resource_group_name="YourResourceGroupName", mitigate_job_request={ "serialNumberCustomerResolutionMap": {"testDISK-1": "MoveToCleanUpDevice", "testDISK-2": "Resume"} }, ) - print(response) # x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobMitigate.json 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 0ae513ad4aa2..af32999621c0 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ @@ -29,12 +30,11 @@ def main(): subscription_id="YourSubscriptionId", ) - response = client.jobs.cancel( + client.jobs.cancel( resource_group_name="YourResourceGroupName", job_name="TestJobName1", cancellation_reason={"reason": "CancelTest"}, ) - print(response) # x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsCancelPost.json 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 20cb83a9f5d9..ea4df71b1660 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_create.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 ddd499355079..7e07d91a6b18 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 43586c612591..0f202d62efef 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 92987af5a6e4..ffbb994db6df 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 6e4301c4c4bb..890906d3bc05 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 6997b47fc00a..66d014809657 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_delete.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_delete.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ @@ -29,11 +30,10 @@ def main(): subscription_id="YourSubscriptionId", ) - response = client.jobs.begin_delete( + client.jobs.begin_delete( resource_group_name="YourResourceGroupName", job_name="TestJobName1", ).result() - print(response) # x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsDelete.json 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 7ed67a69e020..15d13fb72ef7 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_get.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 dac4fa5bba6e..69eb2562fe2a 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 5b6ce0ce8e76..ba3c9a554b73 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 0ba9e91d7282..dc0bedeb620f 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 d956ffd5ba43..074de3797c30 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 6383e85a5241..8b607c64d12e 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_list.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 6a1bccb019af..e18dd0bf3c6b 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 e6b3f7b96590..207d7af5d4b3 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 28decddc681b..64eca807313f 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/jobs_patch.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 4f3bdc733e4e..68679e6bdda1 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 541841f60102..c9fd485711e5 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 47c2c0c4b5d6..7ed79bef7167 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ @@ -29,14 +30,13 @@ def main(): subscription_id="YourSubscriptionId", ) - response = client.jobs.mark_devices_shipped( + client.jobs.mark_devices_shipped( job_name="TestJobName1", resource_group_name="YourResourceGroupName", mark_devices_shipped_request={ "deliverToDcPackageDetails": {"carrierName": "testCarrier", "trackingId": "000000"} }, ) - print(response) # x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/MarkDevicesShipped.json 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 9ba275ad01b6..8c27eea6eba8 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/operations_get.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/operations_get.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 487f53271c87..6443cd61d27d 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/region_configuration.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/region_configuration.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 0063055d826d..ef001951f7de 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 8d10ddf0e5c3..b1406510be5f 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 ec4bfbf97a5f..71b02835229c 100644 --- a/sdk/databox/azure-mgmt-databox/generated_samples/validate_inputs.py +++ b/sdk/databox/azure-mgmt-databox/generated_samples/validate_inputs.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ 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 4b6613759a8b..9219c46fc7ea 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databox import DataBoxManagementClient """ diff --git a/sdk/databox/azure-mgmt-databox/generated_tests/conftest.py b/sdk/databox/azure-mgmt-databox/generated_tests/conftest.py new file mode 100644 index 000000000000..a72d01c731af --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/generated_tests/conftest.py @@ -0,0 +1,35 @@ +# 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 os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# aovid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + databoxmanagement_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + databoxmanagement_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + databoxmanagement_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + databoxmanagement_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=databoxmanagement_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=databoxmanagement_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=databoxmanagement_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=databoxmanagement_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") 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 new file mode 100644 index 000000000000..5702267e2f51 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.databox import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataBoxManagement(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_mitigate(self, resource_group): + response = self.client.mitigate( + job_name="str", + resource_group_name=resource_group.name, + mitigate_job_request={"customerResolutionCode": "str", "serialNumberCustomerResolutionMap": {"str": "str"}}, + api_version="2022-12-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 new file mode 100644 index 000000000000..7b839c679419 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_async.py @@ -0,0 +1,33 @@ +# 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 pytest +from azure.mgmt.databox.aio import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataBoxManagementAsync(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_mitigate(self, resource_group): + response = await self.client.mitigate( + job_name="str", + resource_group_name=resource_group.name, + mitigate_job_request={"customerResolutionCode": "str", "serialNumberCustomerResolutionMap": {"str": "str"}}, + api_version="2022-12-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 new file mode 100644 index 000000000000..7a1c0f820f93 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations.py @@ -0,0 +1,260 @@ +# 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 pytest +from azure.mgmt.databox import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataBoxManagementJobsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.jobs.list( + api_version="2022-12-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_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="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_by_resource_group(self, resource_group): + response = self.client.jobs.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2022-12-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.jobs.get( + resource_group_name=resource_group.name, + job_name="str", + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_create(self, resource_group): + response = self.client.jobs.begin_create( + resource_group_name=resource_group.name, + job_name="str", + job_resource={ + "location": "str", + "sku": {"name": "str", "displayName": "str", "family": "str"}, + "transferType": "str", + "cancellationReason": "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", + }, + "id": "str", + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "None", + "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", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + api_version="2022-12-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_begin_delete(self, resource_group): + response = self.client.jobs.begin_delete( + resource_group_name=resource_group.name, + job_name="str", + api_version="2022-12-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_begin_update(self, resource_group): + response = self.client.jobs.begin_update( + 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": { + "contactDetails": { + "contactName": "str", + "phone": "str", + "mobile": "str", + "phoneExtension": "str", + }, + "isUpdated": bool, + "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", + }, + }, + "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="2022-12-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_book_shipment_pick_up(self, resource_group): + response = self.client.jobs.book_shipment_pick_up( + resource_group_name=resource_group.name, + job_name="str", + shipment_pick_up_request={ + "endTime": "2020-02-20 00:00:00", + "shipmentLocation": "str", + "startTime": "2020-02-20 00:00:00", + }, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cancel(self, resource_group): + response = self.client.jobs.cancel( + resource_group_name=resource_group.name, + job_name="str", + cancellation_reason={"reason": "str"}, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_credentials(self, resource_group): + response = self.client.jobs.list_credentials( + resource_group_name=resource_group.name, + job_name="str", + api_version="2022-12-01", + ) + 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_jobs_operations_async.py b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations_async.py new file mode 100644 index 000000000000..415b0c92e722 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_jobs_operations_async.py @@ -0,0 +1,267 @@ +# 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 pytest +from azure.mgmt.databox.aio import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +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_list(self, resource_group): + response = self.client.jobs.list( + api_version="2022-12-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_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="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_by_resource_group(self, resource_group): + response = self.client.jobs.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2022-12-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_get(self, resource_group): + response = await self.client.jobs.get( + resource_group_name=resource_group.name, + job_name="str", + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_create(self, resource_group): + response = await ( + await self.client.jobs.begin_create( + resource_group_name=resource_group.name, + job_name="str", + job_resource={ + "location": "str", + "sku": {"name": "str", "displayName": "str", "family": "str"}, + "transferType": "str", + "cancellationReason": "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", + }, + "id": "str", + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "None", + "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", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + api_version="2022-12-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_begin_delete(self, resource_group): + response = await ( + await self.client.jobs.begin_delete( + resource_group_name=resource_group.name, + job_name="str", + api_version="2022-12-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_begin_update(self, resource_group): + response = await ( + await self.client.jobs.begin_update( + 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": { + "contactDetails": { + "contactName": "str", + "phone": "str", + "mobile": "str", + "phoneExtension": "str", + }, + "isUpdated": bool, + "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", + }, + }, + "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="2022-12-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_book_shipment_pick_up(self, resource_group): + response = await self.client.jobs.book_shipment_pick_up( + resource_group_name=resource_group.name, + job_name="str", + shipment_pick_up_request={ + "endTime": "2020-02-20 00:00:00", + "shipmentLocation": "str", + "startTime": "2020-02-20 00:00:00", + }, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cancel(self, resource_group): + response = await self.client.jobs.cancel( + resource_group_name=resource_group.name, + job_name="str", + cancellation_reason={"reason": "str"}, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_credentials(self, resource_group): + response = self.client.jobs.list_credentials( + resource_group_name=resource_group.name, + job_name="str", + api_version="2022-12-01", + ) + 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_operations.py b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations.py new file mode 100644 index 000000000000..208de6b86816 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations.py @@ -0,0 +1,29 @@ +# 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 pytest +from azure.mgmt.databox import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataBoxManagementOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.operations.list( + api_version="2022-12-01", + ) + 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 new file mode 100644 index 000000000000..16138bb49fd7 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_operations_async.py @@ -0,0 +1,30 @@ +# 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 pytest +from azure.mgmt.databox.aio import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataBoxManagementOperationsAsync(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_list(self, resource_group): + response = self.client.operations.list( + api_version="2022-12-01", + ) + 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 new file mode 100644 index 000000000000..2e1340cf87fa --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations.py @@ -0,0 +1,126 @@ +# 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 pytest +from azure.mgmt.databox import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataBoxManagementServiceOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_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", + available_sku_request={"country": "str", "location": "str", "transferType": "str", "skuNames": ["str"]}, + api_version="2022-12-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_validate_address(self, resource_group): + response = self.client.service.validate_address( + location="str", + validate_address={ + "deviceType": "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", + }, + "validationType": "ValidateAddress", + "transportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, + }, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_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", + validation_request={ + "individualRequestDetails": ["validation_input_request"], + "validationCategory": "JobCreationValidation", + }, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_validate_inputs(self, resource_group): + response = self.client.service.validate_inputs( + location="str", + validation_request={ + "individualRequestDetails": ["validation_input_request"], + "validationCategory": "JobCreationValidation", + }, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_region_configuration(self, resource_group): + response = self.client.service.region_configuration( + location="str", + region_configuration_request={ + "datacenterAddressRequest": {"skuName": "str", "storageLocation": "str"}, + "scheduleAvailabilityRequest": "schedule_availability_request", + "transportAvailabilityRequest": {"skuName": "str"}, + }, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_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"}, + "scheduleAvailabilityRequest": "schedule_availability_request", + "transportAvailabilityRequest": {"skuName": "str"}, + }, + api_version="2022-12-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 new file mode 100644 index 000000000000..16d05447ea9d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/generated_tests/test_data_box_management_service_operations_async.py @@ -0,0 +1,127 @@ +# 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 pytest +from azure.mgmt.databox.aio import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDataBoxManagementServiceOperationsAsync(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_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", + available_sku_request={"country": "str", "location": "str", "transferType": "str", "skuNames": ["str"]}, + api_version="2022-12-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_validate_address(self, resource_group): + response = await self.client.service.validate_address( + location="str", + validate_address={ + "deviceType": "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", + }, + "validationType": "ValidateAddress", + "transportPreferences": {"preferredShipmentType": "str", "isUpdated": bool}, + }, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_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", + validation_request={ + "individualRequestDetails": ["validation_input_request"], + "validationCategory": "JobCreationValidation", + }, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_validate_inputs(self, resource_group): + response = await self.client.service.validate_inputs( + location="str", + validation_request={ + "individualRequestDetails": ["validation_input_request"], + "validationCategory": "JobCreationValidation", + }, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_region_configuration(self, resource_group): + response = await self.client.service.region_configuration( + location="str", + region_configuration_request={ + "datacenterAddressRequest": {"skuName": "str", "storageLocation": "str"}, + "scheduleAvailabilityRequest": "schedule_availability_request", + "transportAvailabilityRequest": {"skuName": "str"}, + }, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_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"}, + "scheduleAvailabilityRequest": "schedule_availability_request", + "transportAvailabilityRequest": {"skuName": "str"}, + }, + api_version="2022-12-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/databox/azure-mgmt-databox/sdk_packaging.toml b/sdk/databox/azure-mgmt-databox/sdk_packaging.toml index 226bc2429572..ed21d2213961 100644 --- a/sdk/databox/azure-mgmt-databox/sdk_packaging.toml +++ b/sdk/databox/azure-mgmt-databox/sdk_packaging.toml @@ -2,5 +2,5 @@ package_name = "azure-mgmt-databox" package_pprint_name = "Data Box Management" package_doc_id = "" -is_stable = false +is_stable = true title = "DataBoxManagementClient" diff --git a/sdk/databox/azure-mgmt-databox/setup.py b/sdk/databox/azure-mgmt-databox/setup.py index 5b51adced39a..a501a52acfdd 100644 --- a/sdk/databox/azure-mgmt-databox/setup.py +++ b/sdk/databox/azure-mgmt-databox/setup.py @@ -1,10 +1,10 @@ #!/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 @@ -16,64 +16,68 @@ PACKAGE_PPRINT_NAME = "Data Box Management" # a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace('-', '/') +package_folder_path = PACKAGE_NAME.replace("-", "/") # a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace('-', '.') +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) +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') + raise RuntimeError("Cannot find version information") -with open('README.md', encoding='utf-8') as f: +with open("README.md", encoding="utf-8") as f: readme = f.read() -with open('CHANGELOG.md', encoding='utf-8') as f: +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', + 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 :: 4 - Beta', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'License :: OSI Approved :: MIT License', + "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', - ]), + 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'], + "pytyped": ["py.typed"], }, install_requires=[ - "isodate<1.0.0,>=0.6.1", - "azure-common~=1.1", - "azure-mgmt-core>=1.3.2,<2.0.0", - "typing-extensions>=4.3.0; python_version<'3.8.0'", + "isodate>=0.6.1", + "typing-extensions>=4.6.0", + "azure-common>=1.1", + "azure-mgmt-core>=1.3.2", ], - python_requires=">=3.7" + python_requires=">=3.8", ) From c2b8929df85dee2de3ef850a15d78d90f9b176a9 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 Date: Wed, 30 Oct 2024 13:58:16 +0800 Subject: [PATCH 2/2] update-testcase --- sdk/databox/azure-mgmt-databox/CHANGELOG.md | 18 +- .../azure/mgmt/databox/_version.py | 2 +- .../azure-mgmt-databox/dev_requirements.txt | 4 +- sdk/databox/azure-mgmt-databox/setup.py | 8 +- .../azure-mgmt-databox/tests/conftest.py | 35 +++ .../tests/disable_test_cli_mgmt_databox.py | 279 +++++++++--------- ...x_management_jobs_operations_async_test.py | 36 +++ ...ata_box_management_jobs_operations_test.py | 35 +++ ...ta_box_management_operations_async_test.py | 27 ++ ...est_data_box_management_operations_test.py | 26 ++ 10 files changed, 312 insertions(+), 158 deletions(-) create mode 100644 sdk/databox/azure-mgmt-databox/tests/conftest.py create mode 100644 sdk/databox/azure-mgmt-databox/tests/test_data_box_management_jobs_operations_async_test.py create mode 100644 sdk/databox/azure-mgmt-databox/tests/test_data_box_management_jobs_operations_test.py create mode 100644 sdk/databox/azure-mgmt-databox/tests/test_data_box_management_operations_async_test.py create mode 100644 sdk/databox/azure-mgmt-databox/tests/test_data_box_management_operations_test.py diff --git a/sdk/databox/azure-mgmt-databox/CHANGELOG.md b/sdk/databox/azure-mgmt-databox/CHANGELOG.md index 21eb8e46f56a..8c0d80b87921 100644 --- a/sdk/databox/azure-mgmt-databox/CHANGELOG.md +++ b/sdk/databox/azure-mgmt-databox/CHANGELOG.md @@ -1,22 +1,10 @@ # Release History -## 2.1.0 (2024-10-30) +## 3.0.0 (2024-10-30) -### Features Added +### Breaking Changes - - Method `DataBoxManagementClient.mitigate` has a new overload `def mitigate(self: None, job_name: str, resource_group_name: str, mitigate_job_request: IO[bytes], content_type: str)` - - Method `DataBoxManagementClientOperationsMixin.mitigate` has a new overload `def mitigate(self: None, job_name: str, resource_group_name: str, mitigate_job_request: IO[bytes], content_type: str)` - - Method `JobsOperations.begin_create` has a new overload `def begin_create(self: None, resource_group_name: str, job_name: str, job_resource: IO[bytes], content_type: str)` - - Method `JobsOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, job_name: str, job_resource_update_parameter: IO[bytes], if_match: Optional[str], content_type: str)` - - Method `JobsOperations.book_shipment_pick_up` has a new overload `def book_shipment_pick_up(self: None, resource_group_name: str, job_name: str, shipment_pick_up_request: IO[bytes], content_type: str)` - - Method `JobsOperations.cancel` has a new overload `def cancel(self: None, resource_group_name: str, job_name: str, cancellation_reason: IO[bytes], content_type: str)` - - Method `JobsOperations.mark_devices_shipped` has a new overload `def mark_devices_shipped(self: None, job_name: str, resource_group_name: str, mark_devices_shipped_request: IO[bytes], content_type: str)` - - Method `ServiceOperations.list_available_skus_by_resource_group` has a new overload `def list_available_skus_by_resource_group(self: None, resource_group_name: str, location: str, available_sku_request: IO[bytes], content_type: str)` - - Method `ServiceOperations.region_configuration` has a new overload `def region_configuration(self: None, location: str, region_configuration_request: IO[bytes], content_type: str)` - - Method `ServiceOperations.region_configuration_by_resource_group` has a new overload `def region_configuration_by_resource_group(self: None, resource_group_name: str, location: str, region_configuration_request: IO[bytes], content_type: str)` - - Method `ServiceOperations.validate_address` has a new overload `def validate_address(self: None, location: str, validate_address: IO[bytes], content_type: str)` - - Method `ServiceOperations.validate_inputs` has a new overload `def validate_inputs(self: None, location: str, validation_request: IO[bytes], content_type: str)` - - Method `ServiceOperations.validate_inputs_by_resource_group` has a new overload `def validate_inputs_by_resource_group(self: None, resource_group_name: str, location: str, validation_request: IO[bytes], content_type: str)` + - This package now only targets the latest Api-Version available on Azure and removes APIs of other Api-Version. After this change, the package can have much smaller size. If your application requires a specific and non-latest Api-Version, it's recommended to pin this package to the previous released version; If your application always only use latest Api-Version, please ingore this change. ## 2.0.0 (2023-05-22) 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 83f24ab50946..cac9f5d10f8b 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_version.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.1.0" +VERSION = "3.0.0" diff --git a/sdk/databox/azure-mgmt-databox/dev_requirements.txt b/sdk/databox/azure-mgmt-databox/dev_requirements.txt index f6457a93d5e8..8bf78f8c9ae8 100644 --- a/sdk/databox/azure-mgmt-databox/dev_requirements.txt +++ b/sdk/databox/azure-mgmt-databox/dev_requirements.txt @@ -1 +1,3 @@ --e ../../../tools/azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools +-e ../../resources/azure-mgmt-resource +aiohttp diff --git a/sdk/databox/azure-mgmt-databox/setup.py b/sdk/databox/azure-mgmt-databox/setup.py index a501a52acfdd..5b39dfd469f1 100644 --- a/sdk/databox/azure-mgmt-databox/setup.py +++ b/sdk/databox/azure-mgmt-databox/setup.py @@ -22,9 +22,11 @@ # 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"), + ( + 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) diff --git a/sdk/databox/azure-mgmt-databox/tests/conftest.py b/sdk/databox/azure-mgmt-databox/tests/conftest.py new file mode 100644 index 000000000000..a72d01c731af --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/tests/conftest.py @@ -0,0 +1,35 @@ +# 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 os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# aovid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + databoxmanagement_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + databoxmanagement_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + databoxmanagement_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + databoxmanagement_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=databoxmanagement_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=databoxmanagement_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=databoxmanagement_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=databoxmanagement_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/databox/azure-mgmt-databox/tests/disable_test_cli_mgmt_databox.py b/sdk/databox/azure-mgmt-databox/tests/disable_test_cli_mgmt_databox.py index 469e0bc7eb76..a2d676ce4cfb 100644 --- a/sdk/databox/azure-mgmt-databox/tests/disable_test_cli_mgmt_databox.py +++ b/sdk/databox/azure-mgmt-databox/tests/disable_test_cli_mgmt_databox.py @@ -1,10 +1,10 @@ # coding: utf-8 -#------------------------------------------------------------------------- +# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -#-------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # TEST SCENARIO COVERAGE @@ -24,16 +24,15 @@ import azure.mgmt.databox from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer -AZURE_LOCATION = 'eastus' +AZURE_LOCATION = "eastus" + class MgmtDataBoxTest(AzureMgmtTestCase): def setUp(self): super(MgmtDataBoxTest, self).setUp() - self.mgmt_client = self.create_mgmt_client( - azure.mgmt.databox.DataBoxManagementClient - ) - + self.mgmt_client = self.create_mgmt_client(azure.mgmt.databox.DataBoxManagementClient) + @unittest.skip("unavailable in track2") @ResourceGroupPreparer(location=AZURE_LOCATION) def test_databox(self, resource_group): @@ -44,43 +43,45 @@ def test_databox(self, resource_group): if not SUBSCRIPTION_ID: SUBSCRIPTION_ID = self.settings.SUBSCRIPTION_ID RESOURCE_GROUP = resource_group.name - STORAGE_ACCOUNT_NAME = 'databoxaccountabc' - JOB_NAME = 'testjob' + STORAGE_ACCOUNT_NAME = "databoxaccountabc" + JOB_NAME = "testjob" LOCATION_NAME = "westus" # JobsCreate[put] BODY = { - "details": { - "job_details_type": "DataBox", - "contact_details": { - "contact_name": "Public SDK Test", - "phone": "1234567890", - "phone_extension": "1234", - "email_list": [ - "testing@microsoft.com" - ] + "details": { + "job_details_type": "DataBox", + "contact_details": { + "contact_name": "Public SDK Test", + "phone": "1234567890", + "phone_extension": "1234", + "email_list": ["testing@microsoft.com"], + }, + "shipping_address": { + "street_address1": "16 TOWNSEND ST", + "street_address2": "Unit 1", + "city": "San Francisco", + "state_or_province": "CA", + "country": "US", + "postal_code": "94107", + "company_name": "Microsoft", + "address_type": "Commercial", + }, + "destination_account_details": [ + { + "storage_account_id": "/subscriptions/" + + SUBSCRIPTION_ID + + "/resourceGroups/" + + RESOURCE_GROUP + + "/providers/Microsoft.Storage/storageAccounts/" + + STORAGE_ACCOUNT_NAME + + "", + "data_destination_type": "StorageAccount", + } + ], }, - "shipping_address": { - "street_address1": "16 TOWNSEND ST", - "street_address2": "Unit 1", - "city": "San Francisco", - "state_or_province": "CA", - "country": "US", - "postal_code": "94107", - "company_name": "Microsoft", - "address_type": "Commercial" - }, - "destination_account_details": [ - { - "storage_account_id": "/subscriptions/" + SUBSCRIPTION_ID + "/resourceGroups/" + RESOURCE_GROUP + "/providers/Microsoft.Storage/storageAccounts/" + STORAGE_ACCOUNT_NAME + "", - "data_destination_type": "StorageAccount" - } - ] - }, - "location": "westus", - "sku": { - "name": "DataBox" - } + "location": "westus", + "sku": {"name": "DataBox"}, } result = self.mgmt_client.jobs.create(resource_group.name, JOB_NAME, BODY) result = result.result() @@ -114,43 +115,47 @@ def test_databox(self, resource_group): # ServiceValidateInputsByResourceGroup[post] BODY = { - "validation_category": "JobCreationValidation", - "individual_request_details": [ - { - "validation_type": "ValidateDataDestinationDetails", - "location": "westus", - "destination_account_details": [ + "validation_category": "JobCreationValidation", + "individual_request_details": [ { - "storage_account_id": "/subscriptions/" + SUBSCRIPTION_ID + "/resourceGroups/" + RESOURCE_GROUP + "/providers/Microsoft.Storage/storageAccounts/" + STORAGE_ACCOUNT_NAME + "", - "data_destination_type": "StorageAccount" - } - ] - }, - { - "validation_type": "ValidateAddress", - "shipping_address": { - "street_address1": "16 TOWNSEND ST", - "street_address2": "Unit 1", - "city": "San Francisco", - "state_or_province": "CA", - "country": "US", - "postal_code": "94107", - "company_name": "Microsoft", - "address_type": "Commercial" - }, - "device_type": "DataBox" - } - ] + "validation_type": "ValidateDataDestinationDetails", + "location": "westus", + "destination_account_details": [ + { + "storage_account_id": "/subscriptions/" + + SUBSCRIPTION_ID + + "/resourceGroups/" + + RESOURCE_GROUP + + "/providers/Microsoft.Storage/storageAccounts/" + + STORAGE_ACCOUNT_NAME + + "", + "data_destination_type": "StorageAccount", + } + ], + }, + { + "validation_type": "ValidateAddress", + "shipping_address": { + "street_address1": "16 TOWNSEND ST", + "street_address2": "Unit 1", + "city": "San Francisco", + "state_or_province": "CA", + "country": "US", + "postal_code": "94107", + "company_name": "Microsoft", + "address_type": "Commercial", + }, + "device_type": "DataBox", + }, + ], } result = self.mgmt_client.service.validate_inputs_by_resource_group(resource_group.name, LOCATION_NAME, BODY) # AvailableSkusByResourceGroup[post] - BODY = { - "country": "US", - "location": "westus", - "transfer_type": "ImportToAzure" - } - result = self.mgmt_client.service.list_available_skus_by_resource_group(resource_group.name, LOCATION_NAME, BODY) + BODY = {"country": "US", "location": "westus", "transfer_type": "ImportToAzure"} + result = self.mgmt_client.service.list_available_skus_by_resource_group( + resource_group.name, LOCATION_NAME, BODY + ) """ # BookShipmentPickupPost[post] @@ -170,26 +175,24 @@ def test_databox(self, resource_group): # JobsPatch[patch] BODY = { - "details": { - "contact_details": { - "contact_name": "Update Job", - "phone": "1234567890", - "phone_extension": "1234", - "email_list": [ - "testing@microsoft.com" - ] - }, - "shipping_address": { - "street_address1": "16 TOWNSEND ST", - "street_address2": "Unit 1", - "city": "San Francisco", - "state_or_province": "CA", - "country": "US", - "postal_code": "94107", - "company_name": "Microsoft", - "address_type": "Commercial" + "details": { + "contact_details": { + "contact_name": "Update Job", + "phone": "1234567890", + "phone_extension": "1234", + "email_list": ["testing@microsoft.com"], + }, + "shipping_address": { + "street_address1": "16 TOWNSEND ST", + "street_address2": "Unit 1", + "city": "San Francisco", + "state_or_province": "CA", + "country": "US", + "postal_code": "94107", + "company_name": "Microsoft", + "address_type": "Commercial", + }, } - } } result = self.mgmt_client.jobs.update(resource_group.name, JOB_NAME, BODY) result = result.result() @@ -200,43 +203,13 @@ def test_databox(self, resource_group): # "storage_location": "westus", # "sku_name": "DataBox" # } - BODY = None + BODY = None result = self.mgmt_client.service.region_configuration(LOCATION_NAME, BODY) # ValidateAddressPost[post] BODY = { - "validation_type": "ValidateAddress", - "shipping_address": { - "street_address1": "16 TOWNSEND ST", - "street_address2": "Unit 1", - "city": "San Francisco", - "state_or_province": "CA", - "country": "US", - "postal_code": "94107", - "company_name": "Microsoft", - "address_type": "Commercial" - }, - "device_type": "DataBox" - } - result = self.mgmt_client.service.validate_address_method(LOCATION_NAME, BODY) - - # ServiceValidateInputs[post] - BODY = { - "validation_category": "JobCreationValidation", - "individual_request_details": [ - { - "validation_type": "ValidateDataDestinationDetails", - "location": "westus", - "destination_account_details": [ - { - "storage_account_id": "/subscriptions/" + SUBSCRIPTION_ID + "/resourceGroups/" + RESOURCE_GROUP + "/providers/Microsoft.Storage/storageAccounts/" + STORAGE_ACCOUNT_NAME + "", - "data_destination_type": "StorageAccount" - } - ] - }, - { - "validation_type": "ValidateAddress", - "shipping_address": { + "validation_type": "ValidateAddress", + "shipping_address": { "street_address1": "16 TOWNSEND ST", "street_address2": "Unit 1", "city": "San Francisco", @@ -244,26 +217,56 @@ def test_databox(self, resource_group): "country": "US", "postal_code": "94107", "company_name": "Microsoft", - "address_type": "Commercial" - }, - "device_type": "DataBox" - } - ] + "address_type": "Commercial", + }, + "device_type": "DataBox", } - result = self.mgmt_client.service.validate_inputs(LOCATION_NAME, BODY) + result = self.mgmt_client.service.validate_address_method(LOCATION_NAME, BODY) - # AvailableSkusPost[post] + # ServiceValidateInputs[post] BODY = { - "country": "US", - "location": "westus", - "transfer_type": "ImportToAzure" + "validation_category": "JobCreationValidation", + "individual_request_details": [ + { + "validation_type": "ValidateDataDestinationDetails", + "location": "westus", + "destination_account_details": [ + { + "storage_account_id": "/subscriptions/" + + SUBSCRIPTION_ID + + "/resourceGroups/" + + RESOURCE_GROUP + + "/providers/Microsoft.Storage/storageAccounts/" + + STORAGE_ACCOUNT_NAME + + "", + "data_destination_type": "StorageAccount", + } + ], + }, + { + "validation_type": "ValidateAddress", + "shipping_address": { + "street_address1": "16 TOWNSEND ST", + "street_address2": "Unit 1", + "city": "San Francisco", + "state_or_province": "CA", + "country": "US", + "postal_code": "94107", + "company_name": "Microsoft", + "address_type": "Commercial", + }, + "device_type": "DataBox", + }, + ], } + result = self.mgmt_client.service.validate_inputs(LOCATION_NAME, BODY) + + # AvailableSkusPost[post] + BODY = {"country": "US", "location": "westus", "transfer_type": "ImportToAzure"} result = self.mgmt_client.service.list_available_skus(LOCATION_NAME, BODY) # JobsCancelPost[post] - BODY = { - "reason": "CancelTest" - } + BODY = {"reason": "CancelTest"} result = self.mgmt_client.jobs.cancel(resource_group.name, JOB_NAME, BODY) # JobsDelete[delete] @@ -271,6 +274,6 @@ def test_databox(self, resource_group): result = result.result() -#------------------------------------------------------------------------------ -if __name__ == '__main__': +# ------------------------------------------------------------------------------ +if __name__ == "__main__": unittest.main() diff --git a/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_jobs_operations_async_test.py b/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_jobs_operations_async_test.py new file mode 100644 index 000000000000..91486f061e30 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_jobs_operations_async_test.py @@ -0,0 +1,36 @@ +# 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 pytest +from azure.mgmt.databox.aio import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +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_list(self, resource_group): + response = self.client.jobs.list() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_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] + assert result == [] diff --git a/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_jobs_operations_test.py b/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_jobs_operations_test.py new file mode 100644 index 000000000000..63c3fcbf2ca4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_jobs_operations_test.py @@ -0,0 +1,35 @@ +# 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 pytest +from azure.mgmt.databox import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestDataBoxManagementJobsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.jobs.list() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_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] + assert result == [] diff --git a/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_operations_async_test.py b/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_operations_async_test.py new file mode 100644 index 000000000000..0849ed5d5dec --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_operations_async_test.py @@ -0,0 +1,27 @@ +# 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 pytest +from azure.mgmt.databox.aio import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestDataBoxManagementOperationsAsync(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_list(self, resource_group): + response = self.client.operations.list() + result = [r async for r in response] + assert result diff --git a/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_operations_test.py b/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_operations_test.py new file mode 100644 index 000000000000..a313054824d3 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/tests/test_data_box_management_operations_test.py @@ -0,0 +1,26 @@ +# 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 pytest +from azure.mgmt.databox import DataBoxManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestDataBoxManagementOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.operations.list() + result = [r for r in response] + assert result